Package com.maverick.crypto.asn1

Examples of com.maverick.crypto.asn1.DERPrintableString


    {
        byte[]  data = { 0, 1, 0, 1, 0, 0, 1 };
       
        DERObject    values[] = {
                new BERConstructedOctetString(data),
                new BERSequence(new DERPrintableString("hello world")),
                new BERSet(new DERPrintableString("hello world")),
                new BERTaggedObject(0, new DERPrintableString("hello world")),
                new DERApplicationSpecific(0 | DERTags.APPLICATION, data),
                new DERBitString(data),
                new DERBMPString("hello world"),
                new DERBoolean(true),
                new DERBoolean(false),
                new DEREnumerated(100),
                new DERGeneralizedTime(new Date()),
                new DERGeneralString("hello world"),
                new DERIA5String("hello"),
                new DERInteger(1000),
                new DERNull(),
                new DERNumericString("123456"),
                new DERObjectIdentifier("1.1.1.10000.1"),
                new DEROctetString(data),
                new DERPrintableString("hello world"),
                new DERSequence(new DERPrintableString("hello world")),
                new DERSet(new DERPrintableString("hello world")),
                new DERT61String("hello world"),
                new DERTaggedObject(0, new DERPrintableString("hello world")),
                new DERUniversalString(data),
                new DERUnknownTag(0xff & (~(DERTags.TAGGED | DERTags.APPLICATION)), data),
                new DERUTCTime(new Date()),
                new DERUTF8String("hello world"),
                new DERVisibleString("hello world")
View Full Code Here


    }

    private static PKCS10CertificationRequest getCsr(X500Principal subject,
      PublicKey pubKey, PrivateKey priKey, char[] password)
      throws GeneralSecurityException, IOException {
  DERPrintableString cpSet = new DERPrintableString(new String(password));
  SubjectPublicKeyInfo pkInfo = SubjectPublicKeyInfo.getInstance(pubKey
    .getEncoded());

  JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder(
    "SHA1withRSA");
View Full Code Here

    private String getPassword(PKCS10CertificationRequest csr) {
  Attribute[] attrs = csr.getAttributes();
  for (Attribute attr : attrs) {
      if (attr.getAttrType().equals(
        PKCSObjectIdentifiers.pkcs_9_at_challengePassword)) {
    DERPrintableString password = (DERPrintableString) attr
      .getAttrValues().getObjectAt(0);
    return password.getString();
      }
  }
  return null;
    }
View Full Code Here

    }

    PKCS10CertificationRequestBuilder builder = new PKCS10CertificationRequestBuilder(
        subject, pkInfo);
    builder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_challengePassword,
        new DERPrintableString(new String(password)));

    return builder.build(signer);
  }
View Full Code Here

      PKCS10CertificationRequestBuilder csrBuilder = new PKCS10CertificationRequestBuilder(
          entityName, publicKeyInfo);
      // SCEP servers usually require a challenge password
      csrBuilder.addAttribute(
          PKCSObjectIdentifiers.pkcs_9_at_challengePassword,
          new DERPrintableString(new String("password".toCharArray())));
      ContentSigner signer = signerBuilder.build(entityPair.getPrivate());
      PKCS10CertificationRequest csr = csrBuilder.build(signer);
 
      // Send the enrollment request
      EnrollmentResponse response = client
View Full Code Here

  }

  private PKCS10CertificationRequest getCsr(X500Principal subject,
      PublicKey pubKey, PrivateKey priKey, char[] password)
      throws GeneralSecurityException, IOException {
    DERPrintableString cpSet = new DERPrintableString(new String(password));
    SubjectPublicKeyInfo pkInfo = SubjectPublicKeyInfo.getInstance(pubKey
        .getEncoded());

    JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder(
        "SHA1withRSA");
View Full Code Here

  return new Nonce(octets.getOctets());
    }

    private MessageType toMessageType(Attribute attr) {
  final DERPrintableString string = (DERPrintableString) attr
    .getAttrValues().getObjectAt(0);

  return MessageType.valueOf(Integer.valueOf(string.getString()));
    }
View Full Code Here

  return MessageType.valueOf(Integer.valueOf(string.getString()));
    }

    private TransactionId toTransactionId(Attribute attr) {
  final DERPrintableString string = (DERPrintableString) attr
    .getAttrValues().getObjectAt(0);

  return new TransactionId(string.getOctets());
    }
View Full Code Here

  return new TransactionId(string.getOctets());
    }

    private PkiStatus toPkiStatus(Attribute attr) {
  final DERPrintableString string = (DERPrintableString) attr
    .getAttrValues().getObjectAt(0);

  return PkiStatus.valueOf(Integer.valueOf(string.getString()));
    }
View Full Code Here

  return PkiStatus.valueOf(Integer.valueOf(string.getString()));
    }

    private FailInfo toFailInfo(Attribute attr) {
  final DERPrintableString string = (DERPrintableString) attr
    .getAttrValues().getObjectAt(0);

  return FailInfo.valueOf(Integer.valueOf(string.getString()));
    }
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.