Package com.maverick.crypto.asn1

Examples of com.maverick.crypto.asn1.DERPrintableString


      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

            attributes.put(attr.getAttrType(), attr);
            */

            // Message type (certrep)
            oid = new DERObjectIdentifier(ScepRequestMessage.id_messageType);
            value = new DERSet(new DERPrintableString("3"));
            attr = new Attribute(oid, value);
            attributes.put(attr.getAttrType(), attr);

            // TransactionId
            if (transactionId != null) {
                oid = new DERObjectIdentifier(ScepRequestMessage.id_transId);
                log.debug("Added transactionId: " + transactionId);
                value = new DERSet(new DERPrintableString(transactionId));
                attr = new Attribute(oid, value);
                attributes.put(attr.getAttrType(), attr);
            }

            // status
            oid = new DERObjectIdentifier(ScepRequestMessage.id_pkiStatus);
            value = new DERSet(new DERPrintableString(status.getValue()));
            attr = new Attribute(oid, value);
            attributes.put(attr.getAttrType(), attr);

            if (status.equals(ResponseStatus.FAILURE)) {
                oid = new DERObjectIdentifier(ScepRequestMessage.id_failInfo);
                log.debug("Added failInfo: " + failInfo.getValue());
                value = new DERSet(new DERPrintableString(failInfo.getValue()));
                attr = new Attribute(oid, value);
                attributes.put(attr.getAttrType(), attr);
            }

            // senderNonce
View Full Code Here

        Attribute attr;
        DERSet value;
       
        // Message type (certreq)
        oid = new DERObjectIdentifier(ScepRequestMessage.id_messageType);
        value = new DERSet(new DERPrintableString(messageType));
        attr = new Attribute(oid, value);
        attributes.put(attr.getAttrType(), attr);

        // TransactionId
        byte[] digest = CertTools.generateMD5Fingerprint(cert.getPublicKey().getEncoded());
        transactionId = new String(Base64.encode(digest));
        oid = new DERObjectIdentifier(ScepRequestMessage.id_transId);
        value = new DERSet(new DERPrintableString(Base64.encode(digest)));
        attr = new Attribute(oid, value);
        attributes.put(attr.getAttrType(), attr);

        // senderNonce
        byte[] nonce = new byte[16];
View Full Code Here

        Attribute attr;
        DERSet value;
       
        // Message type (certreq)
        oid = new DERObjectIdentifier(ScepRequestMessage.id_messageType);
        value = new DERSet(new DERPrintableString(messageType));
        attr = new Attribute(oid, value);
        attributes.put(attr.getAttrType(), attr);

        // TransactionId
        oid = new DERObjectIdentifier(ScepRequestMessage.id_transId);
        value = new DERSet(new DERPrintableString(transactionId));
        attr = new Attribute(oid, value);
        attributes.put(attr.getAttrType(), attr);

        // senderNonce
        byte[] nonce = new byte[16];
View Full Code Here

    return retval;
  }
 
  private DEREncodable parseDERPrintableString(String value) throws CertificateExtentionConfigurationException {
    try{
      return new DERPrintableString(value,true);
    }catch(java.lang.IllegalArgumentException e){
      throw new CertificateExtentionConfigurationException(intres.getLocalizedMessage("certext.basic.illegalvalue",value,Integer.valueOf(getId())));
    }
  }
View Full Code Here

  public DEREncodable getValue(UserDataVO userData, CA ca,
      CertificateProfile certProfile, PublicKey userPublicKey, PublicKey caPublicKey) throws CertificateExtensionException {
   
    String value = getProperties().getProperty(PROPERTY_VALUE);
   
    return new DERPrintableString(value);
  }
View Full Code Here

  public DEREncodable getValue(final UserDataVO userData, final CA ca, final CertificateProfile certProfile, final PublicKey userPublicKey, final PublicKey caPublicKey)
      throws CertificateExtentionConfigurationException, CertificateExtensionException {
    final String cardnumber = userData.getCardNumber();
    DEREncodable ret = null;
    if (StringUtils.isNotEmpty(cardnumber)) {
      ret = new DERPrintableString(cardnumber);
      if (log.isDebugEnabled()) {
        log.debug("Seis card numer: "+cardnumber);
      }
    } else {
      if (log.isDebugEnabled()) {
View Full Code Here

    }

    private static X509Name buildSubjectDn(X509Name issuerDn, String cnName) {
        ASN1EncodableVector v = new ASN1EncodableVector();
        v.add(X509Name.CN);
        v.add(new DERPrintableString(cnName));
        DERSet rdn = new DERSet(new DERSequence(v));

        ASN1Sequence seq = (ASN1Sequence)duplicate(issuerDn.getDERObject());
        ASN1EncodableVector newSeq = new ASN1EncodableVector();
        int size = seq.size();
View Full Code Here

TOP

Related Classes of com.maverick.crypto.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.