Package sun.security.util

Examples of sun.security.util.ObjectIdentifier


                                   "ExtendedKeyUsageExtension.");
        }
        keyUsages = new Vector<ObjectIdentifier>();
        while (val.data.available() != 0) {
            DerValue seq = val.data.getDerValue();
            ObjectIdentifier usage = seq.getOID();
            keyUsages.addElement(usage);
        }
    }
View Full Code Here


        // wrap the protected private key in a PKCS#8-style
        // EncryptedPrivateKeyInfo, and returns its encoding
        AlgorithmId encrAlg;
        try {
            encrAlg = new AlgorithmId(new ObjectIdentifier(KEY_PROTECTOR_OID));
            return new EncryptedPrivateKeyInfo(encrAlg,encrKey).getEncoded();
        } catch (IOException ioe) {
            throw new KeyStoreException(ioe.getMessage());
        }
    }
View Full Code Here

     * if the <code>name</code> is not recognized of the
     * <code>value</code> has the wrong type.
     */
    public PKCS9Attribute(String name, Object value)
    throws IllegalArgumentException {
        ObjectIdentifier oid = getOID(name);

        if (oid == null)
            throw new IllegalArgumentException(
                       "Unrecognized attribute name " + name +
                       " constructing PKCS9Attribute.");
View Full Code Here

        if (val.length != 2)
            throw new IOException("PKCS9Attribute doesn't have two components");

        // get the oid
        ObjectIdentifier oid = val[0].getOID();
        index = indexOf(oid, PKCS9_OIDS, 1);
        if (index == -1) {
            if (debug != null) {
                debug.println("ignoring unsupported signer attribute: " + oid);
            }
View Full Code Here

    static boolean getNetscapeCertTypeBit(X509Certificate cert, String type) {
        try {
            NetscapeCertTypeExtension ext;
            if (cert instanceof X509CertImpl) {
                X509CertImpl certImpl = (X509CertImpl)cert;
                ObjectIdentifier oid = OBJID_NETSCAPE_CERT_TYPE;
                ext = (NetscapeCertTypeExtension)certImpl.getExtension(oid);
                if (ext == null) {
                    return true;
                }
            } else {
View Full Code Here

        return this;
    }
   
    public X509Builder extKeyUsageServerAuth() {
        try {
            extKeyUsage(new ObjectIdentifier(serverAuthOidData));
        }
        catch(Exception e) {
            fault(e, "extKeyUsageServerAuth");
        }
        return this;
View Full Code Here

        return this;
    }
   
    public X509Builder extKeyUsageClientAuth() {
        try {
            extKeyUsage(new ObjectIdentifier(clientAuthOidData));
        }
        catch(Exception e) {
            fault(e, "extKeyUsageClientAuth");
        }
        return this;
View Full Code Here

    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);
    int[] clientAuthOidData = { 1, 3, 6, 1, 5, 5, 7, 3, 2 };
    ObjectIdentifier clientAuthOid = new ObjectIdentifier(clientAuthOidData);
    Vector<ObjectIdentifier> v = new Vector<ObjectIdentifier>();
    v.add(serverAuthOid);
    v.add(clientAuthOid);
    ExtendedKeyUsageExtension ekue = new ExtendedKeyUsageExtension(false, v);
    ext.set(ExtendedKeyUsageExtension.NAME, ekue);
View Full Code Here

     *
     * @see PKCS9Attribute
     */
    public PKCS9Attributes(PKCS9Attribute[] attribs)
    throws IllegalArgumentException, IOException {
        ObjectIdentifier oid;
        for (int i=0; i < attribs.length; i++) {
            oid = attribs[i].getOID();
            if (attributes.containsKey(oid))
                throw new IllegalArgumentException(
                          "PKCSAttribute " + attribs[i].getOID() +
View Full Code Here

        DerInputStream derIn = new DerInputStream(derEncoding);
        DerValue[] derVals = derIn.getSet(3,true);

        PKCS9Attribute attrib;
        ObjectIdentifier oid;
        boolean reuseEncoding = true;

        for (int i=0; i < derVals.length; i++) {

            try {
View Full Code Here

TOP

Related Classes of sun.security.util.ObjectIdentifier

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.