Examples of AuthorityKeyIdentifierStructure


Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure


    v3CertGen.addExtension(
        X509Extensions.AuthorityKeyIdentifier,
        false,
        new AuthorityKeyIdentifierStructure(caCert.getPublicKey()));

    X509Certificate cert = v3CertGen.generate(caPrivateKey, "BC");

    // For debugging purposes.
    //cert.checkValidity(new Date());
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

        certGen.setSubjectDN(dnName);
        certGen.setPublicKey(keyPair.getPublic());
        certGen.setSignatureAlgorithm("MD5withRSA");

        certGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false,
                new AuthorityKeyIdentifierStructure(keyPair.getPublic()));
        certGen.addExtension(X509Extensions.SubjectKeyIdentifier, false,
                new SubjectKeyIdentifierStructure(keyPair.getPublic()));

        return certGen.generate(keyPair.getPrivate());   // note: private key of CA
    }
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure


    v3CertGen.addExtension(
        X509Extensions.AuthorityKeyIdentifier,
        false,
        new AuthorityKeyIdentifierStructure(caCert.getPublicKey()));

//     Firefox 2 disallows these extensions in an SSL server cert.  IE7 doesn't care.
//    v3CertGen.addExtension(
//        X509Extensions.KeyUsage,
//        false,
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure


    v3CertGen.addExtension(
        X509Extensions.AuthorityKeyIdentifier,
        false,
        new AuthorityKeyIdentifierStructure(caCert.getPublicKey()));

    X509Certificate cert = v3CertGen.generate(caPrivateKey, "BC");

    // For debugging purposes.
    //cert.checkValidity(new Date());
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

    certGen.setSubjectDN(new X500Principal("CN=Test Normalize Certificate subject DN"));
    certGen.setPublicKey(keyPair.getPublic());
    certGen.setSignatureAlgorithm(SIGNATURE_ALGORITHM);

    // 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)
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

    certGen.setSubjectDN(new X500Principal("CN=Test Normalize Certificate subject DN"));
    certGen.setPublicKey(keyPair.getPublic());
    certGen.setSignatureAlgorithm(SIGNATURE_ALGORITHM);

    // 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)
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

    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);
   
    try {
      KeyStore keystore = KeyStore.getInstance("PKCS12");
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

    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);
   
    try {
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

    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);

    try {
      KeyStore keystore = KeyStore.getInstance("PKCS12");
View Full Code Here

Examples of org.bouncycastle.x509.extension.AuthorityKeyIdentifierStructure

    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);

    try {
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.