Examples of IssuerAndSerialNumber


Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

  Nonce senderNonce = recipientNonce;
  X500Name issuer = new X500Name("CN=CA");
  X500Name subject = new X500Name("CN=Client");
  IssuerAndSubject ias = new IssuerAndSubject(issuer, subject);
  BigInteger serial = BigInteger.ONE;
  IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(issuer, serial);
  PKCS10CertificationRequest csr = getCsr(new X500Principal("CN=Client"),
    pair.getPublic(), pair.getPrivate(), "password".toCharArray());
  CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
  ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA")
    .build(pair.getPrivate());
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

    @Before
    public void setUp() {
  TransactionId transId = TransactionId.createTransactionId();
  Nonce nonce = Nonce.nextNonce();
  IssuerAndSerialNumber iasn = mock(IssuerAndSerialNumber.class);
  pkiMessage = new GetCert(transId, nonce, iasn);
  pkiFailureResponse = new CertRep(transId, nonce, nonce,
    FailInfo.badRequest);
  pkiPendingResponse = new CertRep(transId, nonce, nonce);
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

      X509Certificate issued = generateCertificate(pubKey, subject, name,
        getSerial());

      LOGGER.debug("Issuing {}", issued);
      CACHE.put(
        new IssuerAndSerialNumber(name, issued.getSerialNumber()),
        issued);

      return Collections.singletonList(issued);
  } catch (Exception e) {
      LOGGER.debug("Error in enrollment", e);
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

    }

    @Override
    protected List<X509Certificate> doGetCert(X500Name issuer, BigInteger serial)
      throws OperationFailureException {
  IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(issuer, serial);

  LOGGER.debug("Searching cache for {}, {}", iasn.getName(),
    iasn.getSerialNumber());
  if (CACHE.containsKey(iasn)) {
      return Collections.singletonList(CACHE.get(iasn));
  }
  throw new OperationFailureException(FailInfo.badCertId);
    }
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

  TransactionId transId = TransactionId.createTransactionId();
  Nonce senderNonce = Nonce.nextNonce();
  X500Name name = new X500Name("CN=jscep.org");
  BigInteger serialNumber = BigInteger.ONE;
  IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name,
    serialNumber);
  GetCert getCert = new GetCert(transId, senderNonce, iasn);
  PkiOperationRequest req = new PkiOperationRequest(enc.encode(getCert));

  try {
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

    assertThat(certs.getCertificates(null).size(), is(1));
  }

  @Test
  public void testGetCRL() throws Exception {
    IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name, goodSerial);
    PkcsPkiEnvelopeEncoder envEncoder = new PkcsPkiEnvelopeEncoder(
        getRecipient(), "DESede");
    PkiMessageEncoder encoder = new PkiMessageEncoder(priKey, sender,
        envEncoder);
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

    assertThat(s, is(State.CERT_ISSUED));
  }

  @Test
  public void testGetCertBad() throws Exception {
    IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name, badSerial);
    PkcsPkiEnvelopeEncoder envEncoder = new PkcsPkiEnvelopeEncoder(
        getRecipient(), "DES");
    PkiMessageEncoder encoder = new PkiMessageEncoder(priKey, sender,
        envEncoder);
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

        ASN1InputStream asn1inputstream =
            new ASN1InputStream(new ByteArrayInputStream(x509certificate.getTBSCertificate()));
        TBSCertificateStructure tbscertificatestructure =
            TBSCertificateStructure.getInstance(asn1inputstream.readObject());
        AlgorithmIdentifier algorithmidentifier = tbscertificatestructure.getSubjectPublicKeyInfo().getAlgorithmId();
        IssuerAndSerialNumber issuerandserialnumber =
            new IssuerAndSerialNumber(
                tbscertificatestructure.getIssuer(),
                tbscertificatestructure.getSerialNumber().getValue());
        Cipher cipher = Cipher.getInstance(algorithmidentifier.getObjectId().getId());
        cipher.init(1, x509certificate);
        DEROctetString deroctetstring = new DEROctetString(cipher.doFinal(abyte0));
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

    // TRANSACTIONAL
    // CRL query
    checkDistributionPoints(profile);

    X500Name name = new X500Name(issuer.getName());
    IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name, serial);
    Transport transport = createTransport(profile);
    final Transaction t = new NonEnrollmentTransaction(transport,
        getEncoder(identity, key, profile), getDecoder(identity, key,
            profile), iasn, MessageType.GET_CRL);
    State state;
View Full Code Here

Examples of org.bouncycastle.asn1.cms.IssuerAndSerialNumber

    final CertStore store = getCaCertificate(profile);
    CertStoreInspector certs = CertStoreInspector.getInstance(store);
    final X509Certificate ca = certs.getIssuer();

    X500Name name = new X500Name(ca.getIssuerX500Principal().toString());
    IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name, serial);
    Transport transport = createTransport(profile);
    final Transaction t = new NonEnrollmentTransaction(transport,
        getEncoder(identity, key, profile), getDecoder(identity, key,
            profile), iasn, MessageType.GET_CERT);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.