Package org.apache.xml.security.stax.securityToken

Examples of org.apache.xml.security.stax.securityToken.SecurityTokenConstants$KeyUsage


            NetscapeCertType netscapeCertType = new NetscapeCertType(NetscapeCertType.sslClient | NetscapeCertType.sslServer);
            certificateBuilder.addExtension(
                    MiscObjectIdentifiers.netscapeCertType, false,
                    netscapeCertType);

            KeyUsage keyUsage = new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyEncipherment);
            certificateBuilder.addExtension(X509Extension.keyUsage, true,
                    keyUsage);

            ExtendedKeyUsage extendedKeyUsage = new ExtendedKeyUsage(new KeyPurposeId[]{
                KeyPurposeId.id_kp_clientAuth,
View Full Code Here


        new BasicConstraints(0));

    v3CertGen.addExtension(
        X509Extensions.KeyUsage,
        false,
        new KeyUsage(KeyUsage.cRLSign | KeyUsage.keyCertSign) );

    DEREncodableVector typicalCAExtendedKeyUsages = new DEREncodableVector();

    typicalCAExtendedKeyUsages.add(new DERObjectIdentifier(ExtendedKeyUsageConstants.serverAuth));
    typicalCAExtendedKeyUsages.add(new DERObjectIdentifier(ExtendedKeyUsageConstants.OCSPSigning));
View Full Code Here

    // 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
    // key...
    return certGen.generate(rootCertificateInfo.getRootCertificatePrivateKey(), PROVIDER);
View Full Code Here

    // 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
    // key...
    X509Certificate cert = certGen.generate(rootCertificateInfo.getRootCertificatePrivateKey(), PROVIDER);
    // Return a VO containing the normal certificate and is private key
View Full Code Here

                                 true,
                                 new BasicConstraints(false));

        this.certGen.addExtension(X509Extensions.KeyUsage,
                                  true,
                                  new KeyUsage(KeyUsage.digitalSignature |
                                               KeyUsage.keyEncipherment));
    }
View Full Code Here

                                  false,
                                  aki);

        this.certGen.addExtension(X509Extensions.KeyUsage,
                                 false,
                                 new KeyUsage(KeyUsage.cRLSign |
                                              KeyUsage.keyCertSign));

        return this.certGen.generateX509Certificate(keyPair.getPrivate());
    }
View Full Code Here

                                 true,
                                 new BasicConstraints(false));

        this.certGen.addExtension(X509Extensions.KeyUsage,
                                  true,
                                  new KeyUsage(KeyUsage.digitalSignature |
                                               KeyUsage.keyEncipherment));
    }
View Full Code Here

                                  false,
                                  aki);

        this.certGen.addExtension(X509Extensions.KeyUsage,
                                 false,
                                 new KeyUsage(KeyUsage.cRLSign |
                                              KeyUsage.keyCertSign));

        return this.certGen.generateX509Certificate(keyPair.getPrivate());
    }
View Full Code Here

                                 true,
                                 new BasicConstraints(false));

        this.certGen.addExtension(X509Extensions.KeyUsage,
                                  true,
                                  new KeyUsage(KeyUsage.digitalSignature |
                                               KeyUsage.keyEncipherment));
    }
View Full Code Here

            keyPair = PkiTestUtils.generateKeyPair();
            Calendar cal = Calendar.getInstance();
            Date notBefore = cal.getTime();
            cal.add(Calendar.YEAR, 1);
            Date notAfter = cal.getTime();
            KeyUsage keyUsage = new KeyUsage(KeyUsage.digitalSignature);
           
            x509 = PkiTestUtils.generateCertificate(keyPair.getPublic(), subjectDN
                , notBefore, notAfter, null, keyPair.getPrivate(), true, 0, null, null, keyUsage);

            keystore.setKeyEntry(alias, keyPair.getPrivate(), password, new Certificate[]{x509});
View Full Code Here

TOP

Related Classes of org.apache.xml.security.stax.securityToken.SecurityTokenConstants$KeyUsage

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.