Package sun.security.x509

Examples of sun.security.x509.KeyUsageExtension


    }
   
    public X509Builder keyUsageCRLSign() {
        try {
            v3();
            if( keyUsageExtension == null ) { keyUsageExtension = new KeyUsageExtension(); }
            keyUsageExtension.set(KeyUsageExtension.CRL_SIGN, true);
            if( certificateExtensions == null ) { certificateExtensions = new CertificateExtensions(); }
            certificateExtensions.set(keyUsageExtension.getExtensionId().toString(), keyUsageExtension);
            info.set(X509CertInfo.EXTENSIONS, certificateExtensions);            
        }
View Full Code Here


    // "keyCertSign", // (5),
    // "cRLSign", // (6),
    // "encipherOnly", // (7),
    // "decipherOnly", // (8)
    // "contentCommitment" // also (1)
    KeyUsageExtension kue = new KeyUsageExtension(kueOk);
    ext.set(KeyUsageExtension.NAME, kue);

    // Extended Key Usage Extension
    int[] serverAuthOidData = { 1, 3, 6, 1, 5, 5, 7, 3, 1 };
    ObjectIdentifier serverAuthOid = new ObjectIdentifier(serverAuthOidData);
View Full Code Here

    // "keyCertSign", // (5),
    // "cRLSign", // (6),
    // "encipherOnly", // (7),
    // "decipherOnly", // (8)
    // "contentCommitment" // also (1)
    KeyUsageExtension kue = new KeyUsageExtension(kueOk);
    ext.set(KeyUsageExtension.NAME, kue);

    // Extended Key Usage Extension
    int[] serverAuthOidData = { 1, 3, 6, 1, 5, 5, 7, 3, 1 };
    ObjectIdentifier serverAuthOid = new ObjectIdentifier(serverAuthOidData);
View Full Code Here

      nc = null;
        } else {
            ncBytes = (byte []) bytes.clone();
            // validate DER encoding
      try {
                nc = new NameConstraintsExtension(Boolean.FALSE, bytes);
      } catch (IOException ioe) {
    IllegalArgumentException iae =
        new IllegalArgumentException(ioe.getMessage());
    iae.initCause(ioe);
    throw iae;
View Full Code Here

            nc = null;
        } else {
            ncBytes = bytes.clone();
            // validate DER encoding
            try {
                nc = new NameConstraintsExtension(Boolean.FALSE, bytes);
            } catch (IOException ioe) {
                IllegalArgumentException iae =
                    new IllegalArgumentException(ioe.getMessage());
                iae.initCause(ioe);
                throw iae;
View Full Code Here

                        + principal.getPassword() + "\n");
                }
                // SIGNATURE
                if( ( action & WSConstants.SIGN ) > 0 ){
                    X509Certificate cert = secRes.getCertificate();
                    X500Name principal = (X500Name) secRes.getPrincipal();
                    // Do something whith cert
                    System.out.print("Signature for : "  + principal.getCommonName());
                }
            }
        }
    }
View Full Code Here

      keypair = new CertAndKeyGen(keyAlgName, sigAlgName, providerName);

      keypair.generate(keysize);

      PrivateKey privKey = keypair.getPrivateKey();
      X500Name x500name = new X500Name("CN=" + name);
     
      X509Certificate cert
        = keypair.getSelfCertificate(x500name, days * 24 * 3600);

      return new SelfSignedCert(cert, privKey);
View Full Code Here

    String keyPassword = KeyStoreUtils.DEFAULT_KEYSTORE_SECRET;

    int validityDays = 365 * 10;
    String subjectDN = "CN=platformlayer";

    X500Name x500Name;
    try {
      x500Name = new X500Name(subjectDN);
    } catch (IOException e) {
      throw new OpsException("Error building X500 name", e);
    }

    try {
View Full Code Here

    * @throws IOException
    */
   public static X500Name createX500Name(
           String common, String orgUnit, String org, String country)
              throws IOException {
      return new X500Name(common, orgUnit, org, country);
   }
View Full Code Here

    * @throws IOException
    */
   public static X500Name createX500Name(
           String common, String orgUnit, String org, String locality, String state, String country)
              throws IOException {
      return new X500Name(common, orgUnit, org, locality, state, country);
   }
View Full Code Here

TOP

Related Classes of sun.security.x509.KeyUsageExtension

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.