Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.DERPrintableString


    }

    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

    }

    private Attribute getAttribute(FailInfo failInfo) {
  ASN1ObjectIdentifier oid = toOid(FAIL_INFO.id());

  return new Attribute(oid, new DERSet(new DERPrintableString(
    Integer.toString(failInfo.getValue()))));
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.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.