Package org.apache.commons.ssl.asn1

Examples of org.apache.commons.ssl.asn1.DERPrintableString


            throw new IllegalArgumentException("country can only be 2 characters");
        }

        if (fullAge)
        {
            declaration = new DERTaggedObject(false, 1, new DERSequence(new DERPrintableString(country, true)));
        }
        else
        {
            ASN1EncodableVector v = new ASN1EncodableVector();

            v.add(DERBoolean.FALSE);
            v.add(new DERPrintableString(country, true));

            declaration = new DERTaggedObject(false, 1, new DERSequence(v));
        }
    }
View Full Code Here


     * @param amount   The amount
     * @param exponent The exponent
     */
    public MonetaryLimit(String currency, int amount, int exponent)
    {
        this.currency = new DERPrintableString(currency, true);
        this.amount = new DERInteger(amount);
        this.exponent = new DERInteger(exponent);
    }
View Full Code Here

    public DERObject toASN1Object()
    {
        ASN1EncodableVector vec = new ASN1EncodableVector();
        if (country != null)
        {
            vec.add(new DERTaggedObject(true, 1, new DERPrintableString(country, true)));
        }
        if (typeOfSubstitution != null)
        {
            vec.add(new DERTaggedObject(true, 2, typeOfSubstitution));
        }
View Full Code Here

        {
            vec.add(professionOIDs);
        }
        if (registrationNumber != null)
        {
            vec.add(new DERPrintableString(registrationNumber, true));
        }
        if (addProfessionInfo != null)
        {
            vec.add(addProfessionInfo);
        }
View Full Code Here

            {
                return new DERGeneralizedTime(value);
            }
            else if (oid.equals(X509Name.C) || oid.equals(X509Name.SN) || oid.equals(X509Name.DN_QUALIFIER))
            {
                 return new DERPrintableString(value);
            }
        }
       
        return new DERUTF8String(value);
    }
View Full Code Here

        {
            vec.add(new DERTaggedObject(true, 2, placeOfBirth));
        }
        if (gender != null)
        {
            vec.add(new DERTaggedObject(false, 3, new DERPrintableString(gender, true)));
        }
        if (postalAddress != null)
        {
            vec.add(new DERTaggedObject(true, 4, postalAddress));
        }
View Full Code Here

        {
            return new DERIA5String(value);
        }
        else if (canBePrintable(value)) 
        {
            return new DERPrintableString(value);
        }
        else if (canBeUTF8(value))
        {
            return new DERUTF8String(value);
        }
View Full Code Here

      ArrayList<Attribute> ret = new ArrayList<Attribute>();
      Attribute attr = null;
        String value = CertTools.getPartFromDN(dirAttr, "countryOfResidence");
        if (!StringUtils.isEmpty(value)) {
          ASN1EncodableVector vec = new ASN1EncodableVector();
          vec.add(new DERPrintableString(value));
          attr = new Attribute(new DERObjectIdentifier(id_pda_countryOfResidence),new DERSet(vec));
          ret.add(attr);
        }
        value = CertTools.getPartFromDN(dirAttr, "countryOfCitizenship");
        if (!StringUtils.isEmpty(value)) {
          ASN1EncodableVector vec = new ASN1EncodableVector();
          vec.add(new DERPrintableString(value));
          attr = new Attribute(new DERObjectIdentifier(id_pda_countryOfCitizenship),new DERSet(vec));
          ret.add(attr);
        }
        value = CertTools.getPartFromDN(dirAttr, "gender");
        if (!StringUtils.isEmpty(value)) {
          ASN1EncodableVector vec = new ASN1EncodableVector();
          vec.add(new DERPrintableString(value));
          attr = new Attribute(new DERObjectIdentifier(id_pda_gender),new DERSet(vec));
          ret.add(attr);
        }
        value = CertTools.getPartFromDN(dirAttr, "placeOfBirth");
        if (!StringUtils.isEmpty(value)) {
View Full Code Here

      X509Certificate x509cert = (X509Certificate) certificate;
          DERObject obj = CertTools.getExtensionValue(x509cert, SeisCardNumber.OID_CARDNUMBER);
          if (obj == null) {
              return null;
          }
          DERPrintableString number = (DERPrintableString)obj;
          ret = number.getString();
        }
        return ret;           
  }
View Full Code Here

                        senderNonce = new String(Base64.encode(str.getOctets(), false));
                        log.debug("senderNonce = " + senderNonce);
                    }
                    if (a.getAttrType().getId().equals(id_transId)) {
                        Enumeration values = a.getAttrValues().getObjects();
                        DERPrintableString str = DERPrintableString.getInstance(values.nextElement());
                        transactionId = str.getString();
                        log.debug("transactionId = " + transactionId);
                    }
                    if (a.getAttrType().getId().equals(id_messageType)) {
                        Enumeration values = a.getAttrValues().getObjects();
                        DERPrintableString str = DERPrintableString.getInstance(values.nextElement());
                        messageType = Integer.parseInt(str.getString());
                        log.debug("messagetype = " + messageType);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.commons.ssl.asn1.DERPrintableString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.