Package org.bouncycastle.x509.extension

Examples of org.bouncycastle.x509.extension.SubjectKeyIdentifierStructure


    }

    v3CertGen.addExtension(
        X509Extensions.SubjectKeyIdentifier,
        false,
        new SubjectKeyIdentifierStructure(newPubKey));


    v3CertGen.addExtension(
        X509Extensions.AuthorityKeyIdentifier,
        false,
View Full Code Here


    // Add typical extensions for signing cert
    v3CertGen.addExtension(
        X509Extensions.SubjectKeyIdentifier,
        false,
        new SubjectKeyIdentifierStructure(keyPair.getPublic()));

    v3CertGen.addExtension(
        X509Extensions.BasicConstraints,
        true,
        new BasicConstraints(0));
View Full Code Here

    // Add CA authority key identifier extension information
    certGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(rootCertificateInfo.getRootCertificate()));

    // Add subject key identifier
    certGen.addExtension(X509Extensions.SubjectKeyIdentifier, false, new SubjectKeyIdentifierStructure(keyPair.getPublic()));

    // Add key usage (usage of the certificate)
    certGen.addExtension(X509Extensions.KeyUsage, true, new KeyUsage(KeyUsage.digitalSignature | KeyUsage.dataEncipherment));

    // Generate certificate and sign it with the ROOT certificate private
View Full Code Here

    // Add CA authority key identifier extension information
    certGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(rootCertificateInfo.getRootCertificate()));

    // Add subject key identifier
    certGen.addExtension(X509Extensions.SubjectKeyIdentifier, false, new SubjectKeyIdentifierStructure(keyPair.getPublic()));

    // Add key usage (usage of the certificate)
    certGen.addExtension(X509Extensions.KeyUsage, true, new KeyUsage(KeyUsage.digitalSignature | KeyUsage.dataEncipherment));

    // Generate certificate and sign it with the ROOT certificate private
View Full Code Here

    expiry.add(Calendar.DAY_OF_YEAR, validityDays);
    certGen.setNotAfter(expiry.getTime());
    certGen.setSubjectDN(new X500Principal("CN=" + caName));
    certGen.setPublicKey(pubKey);
    certGen.setSignatureAlgorithm("SHA1withRSA");
    certGen.addExtension(X509Extensions.SubjectKeyIdentifier, false, new SubjectKeyIdentifierStructure(pubKey));
    certGen.addExtension(X509Extensions.BasicConstraints, true, new BasicConstraints(true));
    X509Certificate caCert = certGen.generate(privKey);
    certGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(caCert));
    caCert = certGen.generate(privKey);
    FileOutputStream newp12 = new FileOutputStream(p12FileName);
View Full Code Here

    expiry.add(Calendar.DAY_OF_YEAR, validityDays);
    certGen.setNotAfter(expiry.getTime());
    certGen.setSubjectDN(new X500Principal("CN=" + subjectName));
    certGen.setPublicKey(pubKey);
    certGen.setSignatureAlgorithm("SHA1withRSA");
    certGen.addExtension(X509Extensions.SubjectKeyIdentifier, false, new SubjectKeyIdentifierStructure(pubKey));
    certGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(caCert));
    certGen.addExtension(X509Extensions.BasicConstraints, true, new BasicConstraints(false));
    X509Certificate clientCert = certGen.generate(caPrivKey);
    FileOutputStream newp12 = new FileOutputStream(p12FileName);
   
View Full Code Here

    expiry.add(Calendar.DAY_OF_YEAR, validityDays);
    certGen.setNotAfter(expiry.getTime());
    certGen.setSubjectDN(new X500Principal("CN=" + caName));
    certGen.setPublicKey(pubKey);
    certGen.setSignatureAlgorithm("SHA1withRSA");
    certGen.addExtension(org.bouncycastle.asn1.x509.X509Extension.subjectKeyIdentifier /*X509Extensions.SubjectKeyIdentifier*/, false, new SubjectKeyIdentifierStructure(pubKey));
    certGen.addExtension(org.bouncycastle.asn1.x509.X509Extension.basicConstraints /*X509Extensions.BasicConstraints*/, true, new BasicConstraints(true));
    X509Certificate caCert = certGen.generate(privKey);
    certGen.addExtension(org.bouncycastle.asn1.x509.X509Extension.authorityKeyIdentifier /*X509Extensions.AuthorityKeyIdentifier*/, false, new AuthorityKeyIdentifierStructure(caCert));
    caCert = certGen.generate(privKey);
    FileOutputStream newp12 = new FileOutputStream(p12FileName);
View Full Code Here

    expiry.add(Calendar.DAY_OF_YEAR, validityDays);
    certGen.setNotAfter(expiry.getTime());
    certGen.setSubjectDN(new X500Principal("CN=" + subjectName));
    certGen.setPublicKey(pubKey);
    certGen.setSignatureAlgorithm("SHA1withRSA");
    certGen.addExtension(org.bouncycastle.asn1.x509.X509Extension.subjectKeyIdentifier/*X509Extensions.SubjectKeyIdentifier*/, false, new SubjectKeyIdentifierStructure(pubKey));
    certGen.addExtension(org.bouncycastle.asn1.x509.X509Extension.authorityKeyIdentifier /* X509Extensions.AuthorityKeyIdentifier*/, false, new AuthorityKeyIdentifierStructure(caCert));
    certGen.addExtension(org.bouncycastle.asn1.x509.X509Extension.basicConstraints /* X509Extensions.BasicConstraints*/, true, new BasicConstraints(false));
    X509Certificate clientCert = certGen.generate(caPrivKey);
    FileOutputStream newp12 = new FileOutputStream(p12FileName);

View Full Code Here

        new BasicConstraints(false) );

    v3CertGen.addExtension(
        X509Extensions.SubjectKeyIdentifier,
        false,
        new SubjectKeyIdentifierStructure(newPubKey));


    v3CertGen.addExtension(
        X509Extensions.AuthorityKeyIdentifier,
        false,
View Full Code Here

    }

    v3CertGen.addExtension(
        X509Extensions.SubjectKeyIdentifier,
        false,
        new SubjectKeyIdentifierStructure(newPubKey));


    v3CertGen.addExtension(
        X509Extensions.AuthorityKeyIdentifier,
        false,
View Full Code Here

TOP

Related Classes of org.bouncycastle.x509.extension.SubjectKeyIdentifierStructure

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.