harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r390246 [7/15] - in /incubator/harmony/enhanced/classlib/trunk: archive/modules/security/src/main/java/java/security/ modules/archive/src/main/java/java/util/jar/ modules/archive/src/test/java/tests/api/java/util/zip/ modules/beans/src/main...
Date Thu, 30 Mar 2006 21:34:28 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/Signature.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/Signature.java?rev=390246&r1=390245&r2=390246&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/Signature.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/Signature.java Thu Mar 30 13:34:23 2006
@@ -1,494 +1,494 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package java.security;
-
-import java.nio.ByteBuffer;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.harmony.security.fortress.Engine;
-
-
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
-public abstract class Signature extends SignatureSpi {
-    
-    // The service name.
-    private static final String SERVICE = "Signature";
-
-    // Used to accesess common engine functionality
-    private static Engine engine = new Engine(SERVICE);
-
-    // The provider
-    private Provider provider;
-
-    // The algorithm.
-    private String algorithm;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected static final int UNINITIALIZED = 0;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected static final int SIGN = 2;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected static final int VERIFY = 3;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected int state = UNINITIALIZED;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected Signature(String algorithm) {
-        this.algorithm = algorithm;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public static Signature getInstance(String algorithm)
-            throws NoSuchAlgorithmException {
-        if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
-        }
-        Signature result;
-        synchronized (engine) {
-            engine.getInstance(algorithm, null);
-            if (engine.spi instanceof Signature) {
-                result = (Signature) engine.spi;
-                result.algorithm = algorithm;
-                result.provider = engine.provider;
-            } else {
-                result = new SignatureImpl((SignatureSpi) engine.spi,
-                        engine.provider, algorithm);
-            }
-        }
-        return result;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public static Signature getInstance(String algorithm, String provider)
-            throws NoSuchAlgorithmException, NoSuchProviderException {
-        if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException(
-                    "Provider is null or empty string");
-        }
-        Provider p = Security.getProvider(provider);
-        if (p == null) {
-            throw new NoSuchProviderException("Provider " + provider
-                    + " is not available");
-        }
-        return getInstance(algorithm, p);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public static Signature getInstance(String algorithm, Provider provider)
-            throws NoSuchAlgorithmException {
-        if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
-        }
-        if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
-        }
-        Signature result;
-        synchronized (engine) {
-            engine.getInstance(algorithm, provider, null);
-            if (engine.spi instanceof Signature) {
-                result = (Signature) engine.spi;
-                result.algorithm = algorithm;
-                result.provider = provider;
-            } else {
-                result = new SignatureImpl((SignatureSpi) engine.spi, provider,
-                        algorithm);
-            }
-        }
-        return result;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final Provider getProvider() {
-        return provider;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final String getAlgorithm() {
-        return algorithm;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void initVerify(PublicKey publicKey)
-            throws InvalidKeyException {
-        engineInitVerify(publicKey);
-        state = VERIFY;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void initVerify(Certificate certificate)
-            throws InvalidKeyException {
-        if (certificate instanceof X509Certificate) {
-            Set ce = ((X509Certificate) certificate).getCriticalExtensionOIDs();
-            boolean critical = false;
-            if (ce != null && !ce.isEmpty()) {
-                for (Iterator i = ce.iterator(); i.hasNext();) {
-                    if ("2.5.29.15".equals((String) i.next())) { 
-                        //KeyUsage OID = 2.5.29.15
-                        critical = true;
-                        break;
-                    }
-                }
-                if (critical) {
-                    boolean[] keyUsage = ((X509Certificate) certificate)
-                            .getKeyUsage();
-                    // As specified in RFC 3280 -
-                    // Internet X.509 Public Key Infrastructure
-                    // Certificate and Certificate Revocation List (CRL) Profile.
-                    // (http://www.ietf.org/rfc/rfc3280.txt)
-                    //
-                    // KeyUsage ::= BIT STRING { digitalSignature (0), <skipped> }
-                    if ((keyUsage != null) && (!keyUsage[0])) { // digitalSignature
-                        throw new InvalidKeyException(
-                                "The public key in the certificate cannot be used for digital signature purposes");
-                    }
-                }
-            }
-        }
-        engineInitVerify(certificate.getPublicKey());
-        state = VERIFY;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void initSign(PrivateKey privateKey)
-            throws InvalidKeyException {
-        engineInitSign(privateKey);
-        state = SIGN;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void initSign(PrivateKey privateKey, SecureRandom random)
-            throws InvalidKeyException {
-        engineInitSign(privateKey, random);
-        state = SIGN;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final byte[] sign() throws SignatureException {
-        if (state != SIGN) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        return engineSign();
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final int sign(byte[] outbuf, int offset, int len)
-            throws SignatureException {
-        if (state != SIGN) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        if (outbuf == null || offset < 0 || len < 0 ||
-                offset + len > outbuf.length) {
-            throw new IllegalArgumentException(
-                    "Incorrect offset/len parameters");
-        }
-        return engineSign(outbuf, offset, len);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final boolean verify(byte[] signature) throws SignatureException {
-        if (state != VERIFY) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        return engineVerify(signature);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final boolean verify(byte[] signature, int offset, int length)
-            throws SignatureException {
-        if (state != VERIFY) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        if (signature == null || offset < 0 || length < 0 ||
-                offset + length > signature.length) {
-            throw new IllegalArgumentException(
-                    "Incorrect offset/length parameters");
-        }
-        return engineVerify(signature, offset, length);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void update(byte b) throws SignatureException {
-        if (state == UNINITIALIZED) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        engineUpdate(b);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void update(byte[] data) throws SignatureException {
-        if (state == UNINITIALIZED) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        engineUpdate(data, 0, data.length);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void update(byte[] data, int off, int len)
-            throws SignatureException {
-        if (state == UNINITIALIZED) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        if (data == null || off < 0 || len < 0 ||
-                off + len > data.length) {
-            throw new IllegalArgumentException(
-                    "Incorrect offset/len parameters");
-        }
-        engineUpdate(data, off, len);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void update(ByteBuffer data) throws SignatureException {
-        if (state == UNINITIALIZED) {
-            throw new SignatureException(
-                    "Signature object is not initialized properly.");
-        }
-        engineUpdate(data);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public String toString() {
-        return "SIGNATURE " + algorithm + " state: " + stateToString(state);
-    }
-
-    // Convert state to string
-    private String stateToString(int state) {
-        switch (state) {
-        case UNINITIALIZED:
-            return "UNINITIALIZED";
-        case SIGN:
-            return "SIGN";
-        case VERIFY:
-            return "VERIFY";
-        default:
-            return "";
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     * @deprecated Use {@link Signature#setParameter(AlgorithmParameterSpec) setParameter}
-     */
-    public final void setParameter(String param, Object value)
-            throws InvalidParameterException {
-        engineSetParameter(param, value);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final void setParameter(AlgorithmParameterSpec params)
-            throws InvalidAlgorithmParameterException {
-        engineSetParameter(params);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final AlgorithmParameters getParameters() {
-        return engineGetParameters();
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * @deprecated There is no generally accepted parameter naming convention.
-     */
-    public final Object getParameter(String param)
-            throws InvalidParameterException {
-        return engineGetParameter(param);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public Object clone() throws CloneNotSupportedException {
-        if (this instanceof Cloneable) {
-            return super.clone();
-        } else {
-            throw new CloneNotSupportedException();
-        }
-    }
-
-    /**
-     * 
-     * Internal Signature implementation
-     * 
-     */
-    private static class SignatureImpl extends Signature {
-
-        private SignatureSpi spiImpl;
-
-        // Consructor
-        public SignatureImpl(SignatureSpi signatureSpi, Provider provider,
-                String algorithm) {
-            super(algorithm);
-            super.provider = provider;
-            spiImpl = signatureSpi;
-        }
-
-        // engineSign() implementation
-        protected byte[] engineSign() throws SignatureException {
-            return spiImpl.engineSign();
-        }
-
-        //  engineUpdate() implementation
-        protected void engineUpdate(byte arg0) throws SignatureException {
-            spiImpl.engineUpdate(arg0);
-        }
-
-        // engineVerify() implementation
-        protected boolean engineVerify(byte[] arg0) throws SignatureException {
-            return spiImpl.engineVerify(arg0);
-        }
-
-        // engineUpdate() implementation
-        protected void engineUpdate(byte[] arg0, int arg1, int arg2)
-                throws SignatureException {
-            spiImpl.engineUpdate(arg0, arg1, arg2);
-        }
-
-        // engineInitSign() implementation
-        protected void engineInitSign(PrivateKey arg0)
-                throws InvalidKeyException {
-            spiImpl.engineInitSign(arg0);
-        }
-
-        // engineInitVerify() implementation
-        protected void engineInitVerify(PublicKey arg0)
-                throws InvalidKeyException {
-            spiImpl.engineInitVerify(arg0);
-        }
-
-        // engineGetParameter() implementation
-        protected Object engineGetParameter(String arg0)
-                throws InvalidParameterException {
-            return spiImpl.engineGetParameter(arg0);
-        }
-
-        // engineSetParameter() implementation
-        protected void engineSetParameter(String arg0, Object arg1)
-                throws InvalidParameterException {
-            spiImpl.engineSetParameter(arg0, arg1);
-        }
-
-        // Returns a clone if the spiImpl is cloneable
-        public Object clone() throws CloneNotSupportedException {
-            if (spiImpl instanceof Cloneable) {
-                SignatureSpi spi = (SignatureSpi) spiImpl.clone();
-                return new SignatureImpl(spi, getProvider(), getAlgorithm());
-            } else {
-                throw new CloneNotSupportedException();
-            }
-        }
-    }
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Boris V. Kuznetsov
+* @version $Revision$
+*/
+
+package java.security;
+
+import java.nio.ByteBuffer;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.security.spec.AlgorithmParameterSpec;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.harmony.security.fortress.Engine;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * 
+ */
+
+public abstract class Signature extends SignatureSpi {
+    
+    // The service name.
+    private static final String SERVICE = "Signature";
+
+    // Used to access common engine functionality
+    private static Engine engine = new Engine(SERVICE);
+
+    // The provider
+    private Provider provider;
+
+    // The algorithm.
+    private String algorithm;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected static final int UNINITIALIZED = 0;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected static final int SIGN = 2;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected static final int VERIFY = 3;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected int state = UNINITIALIZED;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected Signature(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public static Signature getInstance(String algorithm)
+            throws NoSuchAlgorithmException {
+        if (algorithm == null) {
+            throw new NullPointerException("Algorithm is null");
+        }
+        Signature result;
+        synchronized (engine) {
+            engine.getInstance(algorithm, null);
+            if (engine.spi instanceof Signature) {
+                result = (Signature) engine.spi;
+                result.algorithm = algorithm;
+                result.provider = engine.provider;
+            } else {
+                result = new SignatureImpl((SignatureSpi) engine.spi,
+                        engine.provider, algorithm);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public static Signature getInstance(String algorithm, String provider)
+            throws NoSuchAlgorithmException, NoSuchProviderException {
+        if ((provider == null) || (provider.length() == 0)) {
+            throw new IllegalArgumentException(
+                    "Provider is null or empty string");
+        }
+        Provider p = Security.getProvider(provider);
+        if (p == null) {
+            throw new NoSuchProviderException("Provider " + provider
+                    + " is not available");
+        }
+        return getInstance(algorithm, p);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public static Signature getInstance(String algorithm, Provider provider)
+            throws NoSuchAlgorithmException {
+        if (provider == null) {
+            throw new IllegalArgumentException("Provider is null");
+        }
+        if (algorithm == null) {
+            throw new NullPointerException("Algorithm is null");
+        }
+        Signature result;
+        synchronized (engine) {
+            engine.getInstance(algorithm, provider, null);
+            if (engine.spi instanceof Signature) {
+                result = (Signature) engine.spi;
+                result.algorithm = algorithm;
+                result.provider = provider;
+            } else {
+                result = new SignatureImpl((SignatureSpi) engine.spi, provider,
+                        algorithm);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final Provider getProvider() {
+        return provider;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final String getAlgorithm() {
+        return algorithm;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void initVerify(PublicKey publicKey)
+            throws InvalidKeyException {
+        engineInitVerify(publicKey);
+        state = VERIFY;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void initVerify(Certificate certificate)
+            throws InvalidKeyException {
+        if (certificate instanceof X509Certificate) {
+            Set ce = ((X509Certificate) certificate).getCriticalExtensionOIDs();
+            boolean critical = false;
+            if (ce != null && !ce.isEmpty()) {
+                for (Iterator i = ce.iterator(); i.hasNext();) {
+                    if ("2.5.29.15".equals((String) i.next())) { 
+                        //KeyUsage OID = 2.5.29.15
+                        critical = true;
+                        break;
+                    }
+                }
+                if (critical) {
+                    boolean[] keyUsage = ((X509Certificate) certificate)
+                            .getKeyUsage();
+                    // As specified in RFC 3280 -
+                    // Internet X.509 Public Key Infrastructure
+                    // Certificate and Certificate Revocation List (CRL) Profile.
+                    // (http://www.ietf.org/rfc/rfc3280.txt)
+                    //
+                    // KeyUsage ::= BIT STRING { digitalSignature (0), <skipped> }
+                    if ((keyUsage != null) && (!keyUsage[0])) { // digitalSignature
+                        throw new InvalidKeyException(
+                                "The public key in the certificate cannot be used for digital signature purposes");
+                    }
+                }
+            }
+        }
+        engineInitVerify(certificate.getPublicKey());
+        state = VERIFY;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void initSign(PrivateKey privateKey)
+            throws InvalidKeyException {
+        engineInitSign(privateKey);
+        state = SIGN;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void initSign(PrivateKey privateKey, SecureRandom random)
+            throws InvalidKeyException {
+        engineInitSign(privateKey, random);
+        state = SIGN;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final byte[] sign() throws SignatureException {
+        if (state != SIGN) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        return engineSign();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final int sign(byte[] outbuf, int offset, int len)
+            throws SignatureException {
+        if (state != SIGN) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        if (outbuf == null || offset < 0 || len < 0 ||
+                offset + len > outbuf.length) {
+            throw new IllegalArgumentException(
+                    "Incorrect offset/len parameters");
+        }
+        return engineSign(outbuf, offset, len);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final boolean verify(byte[] signature) throws SignatureException {
+        if (state != VERIFY) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        return engineVerify(signature);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final boolean verify(byte[] signature, int offset, int length)
+            throws SignatureException {
+        if (state != VERIFY) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        if (signature == null || offset < 0 || length < 0 ||
+                offset + length > signature.length) {
+            throw new IllegalArgumentException(
+                    "Incorrect offset/length parameters");
+        }
+        return engineVerify(signature, offset, length);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void update(byte b) throws SignatureException {
+        if (state == UNINITIALIZED) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        engineUpdate(b);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void update(byte[] data) throws SignatureException {
+        if (state == UNINITIALIZED) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        engineUpdate(data, 0, data.length);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void update(byte[] data, int off, int len)
+            throws SignatureException {
+        if (state == UNINITIALIZED) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        if (data == null || off < 0 || len < 0 ||
+                off + len > data.length) {
+            throw new IllegalArgumentException(
+                    "Incorrect offset/len parameters");
+        }
+        engineUpdate(data, off, len);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void update(ByteBuffer data) throws SignatureException {
+        if (state == UNINITIALIZED) {
+            throw new SignatureException(
+                    "Signature object is not initialized properly.");
+        }
+        engineUpdate(data);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public String toString() {
+        return "SIGNATURE " + algorithm + " state: " + stateToString(state);
+    }
+
+    // Convert state to string
+    private String stateToString(int state) {
+        switch (state) {
+        case UNINITIALIZED:
+            return "UNINITIALIZED";
+        case SIGN:
+            return "SIGN";
+        case VERIFY:
+            return "VERIFY";
+        default:
+            return "";
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     * @deprecated Use {@link Signature#setParameter(AlgorithmParameterSpec) setParameter}
+     */
+    public final void setParameter(String param, Object value)
+            throws InvalidParameterException {
+        engineSetParameter(param, value);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final void setParameter(AlgorithmParameterSpec params)
+            throws InvalidAlgorithmParameterException {
+        engineSetParameter(params);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final AlgorithmParameters getParameters() {
+        return engineGetParameters();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * @deprecated There is no generally accepted parameter naming convention.
+     */
+    public final Object getParameter(String param)
+            throws InvalidParameterException {
+        return engineGetParameter(param);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public Object clone() throws CloneNotSupportedException {
+        if (this instanceof Cloneable) {
+            return super.clone();
+        } else {
+            throw new CloneNotSupportedException();
+        }
+    }
+
+    /**
+     * 
+     * Internal Signature implementation
+     * 
+     */
+    private static class SignatureImpl extends Signature {
+
+        private SignatureSpi spiImpl;
+
+        // Consructor
+        public SignatureImpl(SignatureSpi signatureSpi, Provider provider,
+                String algorithm) {
+            super(algorithm);
+            super.provider = provider;
+            spiImpl = signatureSpi;
+        }
+
+        // engineSign() implementation
+        protected byte[] engineSign() throws SignatureException {
+            return spiImpl.engineSign();
+        }
+
+        //  engineUpdate() implementation
+        protected void engineUpdate(byte arg0) throws SignatureException {
+            spiImpl.engineUpdate(arg0);
+        }
+
+        // engineVerify() implementation
+        protected boolean engineVerify(byte[] arg0) throws SignatureException {
+            return spiImpl.engineVerify(arg0);
+        }
+
+        // engineUpdate() implementation
+        protected void engineUpdate(byte[] arg0, int arg1, int arg2)
+                throws SignatureException {
+            spiImpl.engineUpdate(arg0, arg1, arg2);
+        }
+
+        // engineInitSign() implementation
+        protected void engineInitSign(PrivateKey arg0)
+                throws InvalidKeyException {
+            spiImpl.engineInitSign(arg0);
+        }
+
+        // engineInitVerify() implementation
+        protected void engineInitVerify(PublicKey arg0)
+                throws InvalidKeyException {
+            spiImpl.engineInitVerify(arg0);
+        }
+
+        // engineGetParameter() implementation
+        protected Object engineGetParameter(String arg0)
+                throws InvalidParameterException {
+            return spiImpl.engineGetParameter(arg0);
+        }
+
+        // engineSetParameter() implementation
+        protected void engineSetParameter(String arg0, Object arg1)
+                throws InvalidParameterException {
+            spiImpl.engineSetParameter(arg0, arg1);
+        }
+
+        // Returns a clone if the spiImpl is cloneable
+        public Object clone() throws CloneNotSupportedException {
+            if (spiImpl instanceof Cloneable) {
+                SignatureSpi spi = (SignatureSpi) spiImpl.clone();
+                return new SignatureImpl(spi, getProvider(), getAlgorithm());
+            } else {
+                throw new CloneNotSupportedException();
+            }
+        }
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathBuilder.java?rev=390246&r1=390245&r2=390246&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathBuilder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathBuilder.java Thu Mar 30 13:34:23 2006
@@ -1,169 +1,169 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.AccessController;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-
-import org.apache.harmony.security.fortress.Engine;
-
-
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
-public class CertPathBuilder {
-
-    // Store CertPathBuilder service name
-    private static final String SERVICE = "CertPathBuilder";
-
-    // Used to accesess common engine functionality
-    private static Engine engine = new Engine(SERVICE);
-
-    // Store default property name
-    private static final String PROPERTYNAME = "certpathbuild.type";
-
-    // Default value of CertPathBuilder type. It returns if certpathbuild.type
-    // property is not defined in java.security file
-    private static final String DEFAULTPROPERTY = "PKIX";
-
-    // Store used provider
-    private final Provider provider;
-
-    // Store spi implementation
-    private CertPathBuilderSpi spiImpl;
-
-    // Store algorithm name
-    private final String algorithm;
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    protected CertPathBuilder(CertPathBuilderSpi builderSpi, Provider provider,
-            String algorithm) {
-        this.provider = provider;
-        this.algorithm = algorithm;
-        this.spiImpl = builderSpi;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final String getAlgorithm() {
-        return algorithm;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final Provider getProvider() {
-        return provider;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if algorithm is null (instead of
-     * NoSuchAlgorithmException as in 1.4 release)
-     */
-    public static CertPathBuilder getInstance(String algorithm)
-            throws NoSuchAlgorithmException {
-        if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
-        }
-        synchronized (engine) {
-            engine.getInstance(algorithm, null);
-            return new CertPathBuilder((CertPathBuilderSpi) engine.spi,
-                    engine.provider, algorithm);
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if algorithm is null (instead of
-     * NoSuchAlgorithmException as in 1.4 release)
-     * 
-     * FIXME: jrockit-j2re1.4.2_04 throws IllegalArgumentException when provider
-     * is empty
-     */
-    public static CertPathBuilder getInstance(String algorithm, String provider)
-            throws NoSuchAlgorithmException, NoSuchProviderException {
-        if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
-        }
-        Provider impProvider = Security.getProvider(provider);
-        if (impProvider == null) {
-            throw new NoSuchProviderException(provider);
-        }
-        return getInstance(algorithm, impProvider);
-
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if algorithm is null (instead of
-     * NoSuchAlgorithmException as in 1.4 release)
-     */
-    public static CertPathBuilder getInstance(String algorithm,
-            Provider provider) throws NoSuchAlgorithmException {
-        if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
-        }
-        if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
-        }
-        synchronized (engine) {
-            engine.getInstance(algorithm, provider, null);
-            return new CertPathBuilder((CertPathBuilderSpi) engine.spi, provider,
-                    algorithm);
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final CertPathBuilderResult build(CertPathParameters params)
-            throws CertPathBuilderException, InvalidAlgorithmParameterException {
-        return spiImpl.engineBuild(params);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public static final String getDefaultType() {
-        String defaultType = (String) AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
-                    public Object run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                }
-            );
-        return (defaultType != null ? defaultType : DEFAULTPROPERTY);
-    }
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package java.security.cert;
+
+import java.security.AccessController;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.Security;
+
+import org.apache.harmony.security.fortress.Engine;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * 
+ */
+
+public class CertPathBuilder {
+
+    // Store CertPathBuilder service name
+    private static final String SERVICE = "CertPathBuilder";
+
+    // Used to access common engine functionality
+    private static Engine engine = new Engine(SERVICE);
+
+    // Store default property name
+    private static final String PROPERTYNAME = "certpathbuild.type";
+
+    // Default value of CertPathBuilder type. It returns if certpathbuild.type
+    // property is not defined in java.security file
+    private static final String DEFAULTPROPERTY = "PKIX";
+
+    // Store used provider
+    private final Provider provider;
+
+    // Store spi implementation
+    private CertPathBuilderSpi spiImpl;
+
+    // Store algorithm name
+    private final String algorithm;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    protected CertPathBuilder(CertPathBuilderSpi builderSpi, Provider provider,
+            String algorithm) {
+        this.provider = provider;
+        this.algorithm = algorithm;
+        this.spiImpl = builderSpi;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final String getAlgorithm() {
+        return algorithm;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final Provider getProvider() {
+        return provider;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if algorithm is null (instead of
+     * NoSuchAlgorithmException as in 1.4 release)
+     */
+    public static CertPathBuilder getInstance(String algorithm)
+            throws NoSuchAlgorithmException {
+        if (algorithm == null) {
+            throw new NullPointerException("algorithm is null");
+        }
+        synchronized (engine) {
+            engine.getInstance(algorithm, null);
+            return new CertPathBuilder((CertPathBuilderSpi) engine.spi,
+                    engine.provider, algorithm);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if algorithm is null (instead of
+     * NoSuchAlgorithmException as in 1.4 release)
+     * 
+     * FIXME: jrockit-j2re1.4.2_04 throws IllegalArgumentException when provider
+     * is empty
+     */
+    public static CertPathBuilder getInstance(String algorithm, String provider)
+            throws NoSuchAlgorithmException, NoSuchProviderException {
+        if ((provider == null) || (provider.length() == 0)) {
+            throw new IllegalArgumentException("Provider is null or empty");
+        }
+        Provider impProvider = Security.getProvider(provider);
+        if (impProvider == null) {
+            throw new NoSuchProviderException(provider);
+        }
+        return getInstance(algorithm, impProvider);
+
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if algorithm is null (instead of
+     * NoSuchAlgorithmException as in 1.4 release)
+     */
+    public static CertPathBuilder getInstance(String algorithm,
+            Provider provider) throws NoSuchAlgorithmException {
+        if (provider == null) {
+            throw new IllegalArgumentException("Provider is null");
+        }
+        if (algorithm == null) {
+            throw new NullPointerException("algorithm is null");
+        }
+        synchronized (engine) {
+            engine.getInstance(algorithm, provider, null);
+            return new CertPathBuilder((CertPathBuilderSpi) engine.spi, provider,
+                    algorithm);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final CertPathBuilderResult build(CertPathParameters params)
+            throws CertPathBuilderException, InvalidAlgorithmParameterException {
+        return spiImpl.engineBuild(params);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final String getDefaultType() {
+        String defaultType = (String) AccessController.doPrivileged(
+                new java.security.PrivilegedAction() {
+                    public Object run() {
+                        return Security.getProperty(PROPERTYNAME);
+                    }
+                }
+            );
+        return (defaultType != null ? defaultType : DEFAULTPROPERTY);
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathValidator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathValidator.java?rev=390246&r1=390245&r2=390246&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathValidator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertPathValidator.java Thu Mar 30 13:34:23 2006
@@ -1,168 +1,168 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.AccessController;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-
-import org.apache.harmony.security.fortress.Engine;
-
-
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
-public class CertPathValidator {
-    // Store CertPathValidator implementation service name
-    private static final String SERVICE = "CertPathValidator";
-
-    // Used to accesess common engine functionality
-    private static Engine engine = new Engine(SERVICE);
-
-    // Store default property name
-    private static final String PROPERTYNAME = "certpathvalidator.type";
-
-    // Default value of CertPathBuilder type. It returns if certpathbuild.type
-    // property is not defined in java.security file
-    private static final String DEFAULTPROPERTY = "PKIX";
-
-    // Store used provider
-    private final Provider provider;
-
-    // Store used spi implementation
-    private final CertPathValidatorSpi spiImpl;
-
-    // Store used algorithm value
-    private final String algorithm;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected CertPathValidator(CertPathValidatorSpi validatorSpi,
-            Provider provider, String algorithm) {
-        this.provider = provider;
-        this.algorithm = algorithm;
-        this.spiImpl = validatorSpi;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final String getAlgorithm() {
-        return algorithm;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public final Provider getProvider() {
-        return provider;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if algorithm is null
-     */
-    public static CertPathValidator getInstance(String algorithm)
-            throws NoSuchAlgorithmException {
-        if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
-        }
-        synchronized (engine) {
-            engine.getInstance(algorithm, null);
-            return new CertPathValidator((CertPathValidatorSpi) engine.spi,
-                    engine.provider, algorithm);
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if algorithm is null
-     */
-    public static CertPathValidator getInstance(String algorithm,
-            String provider) throws NoSuchAlgorithmException,
-            NoSuchProviderException {
-        if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
-        }
-        Provider impProvider = Security.getProvider(provider);
-        if (impProvider == null) {
-            throw new NoSuchProviderException(provider);
-        }
-        return getInstance(algorithm, impProvider);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref*
-     * 
-     * throws NullPointerException if algorithm is null
-     */
-    public static CertPathValidator getInstance(String algorithm,
-            Provider provider) throws NoSuchAlgorithmException {
-        if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
-        }
-        if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
-        }
-        synchronized (engine) {
-            engine.getInstance(algorithm, provider, null);
-            return new CertPathValidator((CertPathValidatorSpi) engine.spi,
-                    provider, algorithm);
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     */
-    public final CertPathValidatorResult validate(CertPath certPath,
-            CertPathParameters params) throws CertPathValidatorException,
-            InvalidAlgorithmParameterException {
-        return spiImpl.engineValidate(certPath, params);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    public static final String getDefaultType() {
-        String defaultType = (String) AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
-                    public Object run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                }
-            );
-        return (defaultType != null ? defaultType : DEFAULTPROPERTY);
-    }
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package java.security.cert;
+
+import java.security.AccessController;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.Security;
+
+import org.apache.harmony.security.fortress.Engine;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * 
+ */
+
+public class CertPathValidator {
+    // Store CertPathValidator implementation service name
+    private static final String SERVICE = "CertPathValidator";
+
+    // Used to access common engine functionality
+    private static Engine engine = new Engine(SERVICE);
+
+    // Store default property name
+    private static final String PROPERTYNAME = "certpathvalidator.type";
+
+    // Default value of CertPathBuilder type. It returns if certpathbuild.type
+    // property is not defined in java.security file
+    private static final String DEFAULTPROPERTY = "PKIX";
+
+    // Store used provider
+    private final Provider provider;
+
+    // Store used spi implementation
+    private final CertPathValidatorSpi spiImpl;
+
+    // Store used algorithm value
+    private final String algorithm;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected CertPathValidator(CertPathValidatorSpi validatorSpi,
+            Provider provider, String algorithm) {
+        this.provider = provider;
+        this.algorithm = algorithm;
+        this.spiImpl = validatorSpi;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final String getAlgorithm() {
+        return algorithm;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public final Provider getProvider() {
+        return provider;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if algorithm is null
+     */
+    public static CertPathValidator getInstance(String algorithm)
+            throws NoSuchAlgorithmException {
+        if (algorithm == null) {
+            throw new NullPointerException("algorithm is null");
+        }
+        synchronized (engine) {
+            engine.getInstance(algorithm, null);
+            return new CertPathValidator((CertPathValidatorSpi) engine.spi,
+                    engine.provider, algorithm);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if algorithm is null
+     */
+    public static CertPathValidator getInstance(String algorithm,
+            String provider) throws NoSuchAlgorithmException,
+            NoSuchProviderException {
+        if ((provider == null) || (provider.length() == 0)) {
+            throw new IllegalArgumentException("Provider is null or empty");
+        }
+        Provider impProvider = Security.getProvider(provider);
+        if (impProvider == null) {
+            throw new NoSuchProviderException(provider);
+        }
+        return getInstance(algorithm, impProvider);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref*
+     * 
+     * throws NullPointerException if algorithm is null
+     */
+    public static CertPathValidator getInstance(String algorithm,
+            Provider provider) throws NoSuchAlgorithmException {
+        if (provider == null) {
+            throw new IllegalArgumentException("Provider is null");
+        }
+        if (algorithm == null) {
+            throw new NullPointerException("algorithm is null");
+        }
+        synchronized (engine) {
+            engine.getInstance(algorithm, provider, null);
+            return new CertPathValidator((CertPathValidatorSpi) engine.spi,
+                    provider, algorithm);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     */
+    public final CertPathValidatorResult validate(CertPath certPath,
+            CertPathParameters params) throws CertPathValidatorException,
+            InvalidAlgorithmParameterException {
+        return spiImpl.engineValidate(certPath, params);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    public static final String getDefaultType() {
+        String defaultType = (String) AccessController.doPrivileged(
+                new java.security.PrivilegedAction() {
+                    public Object run() {
+                        return Security.getProperty(PROPERTYNAME);
+                    }
+                }
+            );
+        return (defaultType != null ? defaultType : DEFAULTPROPERTY);
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertStore.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertStore.java?rev=390246&r1=390245&r2=390246&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertStore.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertStore.java Thu Mar 30 13:34:23 2006
@@ -1,212 +1,212 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.AccessController;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-import java.util.Collection;
-
-import org.apache.harmony.security.fortress.Engine;
-
-
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
-public class CertStore {
-
-    // Store spi implementation service name
-    private static final String SERVICE = "CertStore";
-
-    // Used to accesess common engine functionality
-    private static Engine engine = new Engine(SERVICE);
-
-    // Store default property name
-    private static final String PROPERTYNAME = "certstore.type";
-
-    // Default value of CertStore type. It returns if certpathbuild.type
-    // property is not defined in java.security file
-    private static final String DEFAULTPROPERTY = "LDAP";
-
-    // Store used provider
-    private final Provider provider;
-
-    // Store CertStoreSpi implementation
-    private final CertStoreSpi spiImpl;
-
-    // Store used type
-    private final String type;
-
-    // Store used parameters
-    private final CertStoreParameters certStoreParams;
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    protected CertStore(CertStoreSpi storeSpi, Provider provider, String type,
-            CertStoreParameters params) {
-        this.provider = provider;
-        this.type = type;
-        this.spiImpl = storeSpi;
-        this.certStoreParams = params;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if type is null (instead of
-     * NoSuchAlgorithmException as in 1.4 release)
-     */
-    public static CertStore getInstance(String type, CertStoreParameters params)
-            throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
-        if (type == null) {
-            throw new NullPointerException("type is null");
-        }
-        try {
-            synchronized (engine) {
-                engine.getInstance(type, params);
-                return new CertStore((CertStoreSpi) engine.spi, engine.provider,
-                        type, params);
-            }
-        } catch (NoSuchAlgorithmException e) {
-            Throwable th = e.getCause();
-            if (th == null) {
-                throw e;
-            } else {
-                throw new InvalidAlgorithmParameterException(e.getMessage(), th);
-            }
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if type is null (instead of
-     * NoSuchAlgorithmException as in 1.4 release)
-     * 
-     * FIXME: IllegalArgumentException when provider is empty
-     */
-    public static CertStore getInstance(String type,
-            CertStoreParameters params, String provider)
-            throws InvalidAlgorithmParameterException,
-            NoSuchAlgorithmException, NoSuchProviderException {
-        if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
-        }
-        Provider impProvider = Security.getProvider(provider);
-        if (impProvider == null) {
-            throw new NoSuchProviderException(provider);
-        }
-        return getInstance(type, params, impProvider);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if type is null (instead of
-     * NoSuchAlgorithmException as in 1.4 release)
-     */
-    public static CertStore getInstance(String type,
-            CertStoreParameters params, Provider provider)
-            throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
-        if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
-        }
-        if (type == null) {
-            throw new NullPointerException("type is null");
-        }
-        try {
-            synchronized (engine) {
-                engine.getInstance(type, provider, params);
-                return new CertStore((CertStoreSpi) engine.spi, provider, type,
-                        params);
-            }
-        } catch (NoSuchAlgorithmException e) {
-            Throwable th = e.getCause();
-            if (th == null) {
-                throw e;
-            } else {
-                throw new InvalidAlgorithmParameterException(e.getMessage(), th);
-            }
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final String getType() {
-        return type;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final Provider getProvider() {
-        return provider;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final CertStoreParameters getCertStoreParameters() {
-        if (certStoreParams == null) {
-            return null;
-        } else {
-            return (CertStoreParameters) certStoreParams.clone();
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final Collection getCertificates(CertSelector selector)
-            throws CertStoreException {
-        return spiImpl.engineGetCertificates(selector);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final Collection getCRLs(CRLSelector selector)
-            throws CertStoreException {
-        return spiImpl.engineGetCRLs(selector);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public static final String getDefaultType() {
-        String defaultType = (String) AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
-                    public Object run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                }
-            );
-        return (defaultType == null ? DEFAULTPROPERTY : defaultType);
-    }
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package java.security.cert;
+
+import java.security.AccessController;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.Security;
+import java.util.Collection;
+
+import org.apache.harmony.security.fortress.Engine;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * 
+ */
+
+public class CertStore {
+
+    // Store spi implementation service name
+    private static final String SERVICE = "CertStore";
+
+    // Used to access common engine functionality
+    private static Engine engine = new Engine(SERVICE);
+
+    // Store default property name
+    private static final String PROPERTYNAME = "certstore.type";
+
+    // Default value of CertStore type. It returns if certpathbuild.type
+    // property is not defined in java.security file
+    private static final String DEFAULTPROPERTY = "LDAP";
+
+    // Store used provider
+    private final Provider provider;
+
+    // Store CertStoreSpi implementation
+    private final CertStoreSpi spiImpl;
+
+    // Store used type
+    private final String type;
+
+    // Store used parameters
+    private final CertStoreParameters certStoreParams;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    protected CertStore(CertStoreSpi storeSpi, Provider provider, String type,
+            CertStoreParameters params) {
+        this.provider = provider;
+        this.type = type;
+        this.spiImpl = storeSpi;
+        this.certStoreParams = params;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if type is null (instead of
+     * NoSuchAlgorithmException as in 1.4 release)
+     */
+    public static CertStore getInstance(String type, CertStoreParameters params)
+            throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
+        if (type == null) {
+            throw new NullPointerException("type is null");
+        }
+        try {
+            synchronized (engine) {
+                engine.getInstance(type, params);
+                return new CertStore((CertStoreSpi) engine.spi, engine.provider,
+                        type, params);
+            }
+        } catch (NoSuchAlgorithmException e) {
+            Throwable th = e.getCause();
+            if (th == null) {
+                throw e;
+            } else {
+                throw new InvalidAlgorithmParameterException(e.getMessage(), th);
+            }
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if type is null (instead of
+     * NoSuchAlgorithmException as in 1.4 release)
+     * 
+     * FIXME: IllegalArgumentException when provider is empty
+     */
+    public static CertStore getInstance(String type,
+            CertStoreParameters params, String provider)
+            throws InvalidAlgorithmParameterException,
+            NoSuchAlgorithmException, NoSuchProviderException {
+        if ((provider == null) || (provider.length() == 0)) {
+            throw new IllegalArgumentException("Provider is null or empty");
+        }
+        Provider impProvider = Security.getProvider(provider);
+        if (impProvider == null) {
+            throw new NoSuchProviderException(provider);
+        }
+        return getInstance(type, params, impProvider);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if type is null (instead of
+     * NoSuchAlgorithmException as in 1.4 release)
+     */
+    public static CertStore getInstance(String type,
+            CertStoreParameters params, Provider provider)
+            throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
+        if (provider == null) {
+            throw new IllegalArgumentException("Provider is null");
+        }
+        if (type == null) {
+            throw new NullPointerException("type is null");
+        }
+        try {
+            synchronized (engine) {
+                engine.getInstance(type, provider, params);
+                return new CertStore((CertStoreSpi) engine.spi, provider, type,
+                        params);
+            }
+        } catch (NoSuchAlgorithmException e) {
+            Throwable th = e.getCause();
+            if (th == null) {
+                throw e;
+            } else {
+                throw new InvalidAlgorithmParameterException(e.getMessage(), th);
+            }
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final String getType() {
+        return type;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final Provider getProvider() {
+        return provider;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final CertStoreParameters getCertStoreParameters() {
+        if (certStoreParams == null) {
+            return null;
+        } else {
+            return (CertStoreParameters) certStoreParams.clone();
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final Collection getCertificates(CertSelector selector)
+            throws CertStoreException {
+        return spiImpl.engineGetCertificates(selector);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final Collection getCRLs(CRLSelector selector)
+            throws CertStoreException {
+        return spiImpl.engineGetCRLs(selector);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final String getDefaultType() {
+        String defaultType = (String) AccessController.doPrivileged(
+                new java.security.PrivilegedAction() {
+                    public Object run() {
+                        return Security.getProperty(PROPERTYNAME);
+                    }
+                }
+            );
+        return (defaultType == null ? DEFAULTPROPERTY : defaultType);
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertificateFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertificateFactory.java?rev=390246&r1=390245&r2=390246&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertificateFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/CertificateFactory.java Thu Mar 30 13:34:23 2006
@@ -1,226 +1,226 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.io.InputStream;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.harmony.security.fortress.Engine;
-
-
-/**
- * @com.intel.drl.spec_ref
- * 
- */
-
-public class CertificateFactory {
-
-    // Store CertificateFactory service name
-    private static final String SERVICE = "CertificateFactory";
-
-    // Used to accesess common engine functionality
-    private static Engine engine = new Engine(SERVICE);
-
-    // Store used provider
-    private final Provider provider;
-
-    // Store used CertificateFactorySpi implementation
-    private final CertificateFactorySpi spiImpl;
-
-    // Store used type
-    private final String type;
-
-    /**
-     * @com.intel.drl.spec_ref
-     *  
-     */
-    protected CertificateFactory(CertificateFactorySpi certFacSpi,
-            Provider provider, String type) {
-        this.provider = provider;
-        this.type = type;
-        this.spiImpl = certFacSpi;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws CertificateException using NoSuchAlgorithmException information
-     * 
-     * throws NullPointerException if algorithm is null (instead of
-     * CertificateException as in 1.4 release)
-     */
-    public static final CertificateFactory getInstance(String type)
-            throws CertificateException {
-        if (type == null) {
-            throw new NullPointerException("type is null");
-        }
-        try {
-            synchronized (engine) {
-                engine.getInstance(type, null);
-                return new CertificateFactory((CertificateFactorySpi) engine.spi,
-                        engine.provider, type);
-            }
-        } catch (NoSuchAlgorithmException e) {
-            throw new CertificateException(e);
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws NullPointerException if algorithm is null (instead of
-     * CertificateException as in 1.4 release)
-     */
-    public static final CertificateFactory getInstance(String type,
-            String provider) throws CertificateException,
-            NoSuchProviderException {
-        if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
-        }
-        Provider impProvider = Security.getProvider(provider);
-        if (impProvider == null) {
-            throw new NoSuchProviderException(provider);
-        }
-        return getInstance(type, impProvider);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * throws CertificateException using NoSuchAlgorithmException information
-     * 
-     * throws NullPointerException if algorithm is null (instead of
-     * CertificateException as in 1.4 release)
-     */
-    public static final CertificateFactory getInstance(String type,
-            Provider provider) throws CertificateException {
-        if (provider == null) {
-            throw new IllegalArgumentException("Proveder is null");
-        }
-        if (type == null) {
-            throw new NullPointerException("type is null");
-        }
-        try {
-            synchronized (engine) {
-                engine.getInstance(type, provider, null);
-                return new CertificateFactory((CertificateFactorySpi) engine.spi,
-                        provider, type);
-            }
-        } catch (NoSuchAlgorithmException e) {
-            throw new CertificateException(e.getMessage());
-        }
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final Provider getProvider() {
-        return provider;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final String getType() {
-        return type;
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final Certificate generateCertificate(InputStream inStream)
-            throws CertificateException {
-        return spiImpl.engineGenerateCertificate(inStream);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * FIXME: update to Iterator <String>getCertPathEncodings()
-     */
-    public final Iterator getCertPathEncodings() {
-        return spiImpl.engineGetCertPathEncodings();
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final CertPath generateCertPath(InputStream inStream)
-            throws CertificateException {
-        Iterator it = getCertPathEncodings();
-        if (!it.hasNext()) {
-            throw new CertificateException("There are no CertPath encodings");
-        }
-        return spiImpl.engineGenerateCertPath(inStream, (String) it.next());
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final CertPath generateCertPath(InputStream inStream, String encoding)
-            throws CertificateException {
-        return spiImpl.engineGenerateCertPath(inStream, encoding);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * FIXME: update parameter to (List <? extends Certificate> certificates)
-     */
-    public final CertPath generateCertPath(List certificates)
-            throws CertificateException {
-        return spiImpl.engineGenerateCertPath(certificates);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * FIXME: update returned value to Collection <? extends Certificate>
-     */
-    public final Collection generateCertificates(InputStream inStream)
-            throws CertificateException {
-        return spiImpl.engineGenerateCertificates(inStream);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     */
-    public final CRL generateCRL(InputStream inStream) throws CRLException {
-        return spiImpl.engineGenerateCRL(inStream);
-    }
-
-    /**
-     * @com.intel.drl.spec_ref
-     * 
-     * FIXME: update returned value to Collection <? extends CRL>
-     */
-    public final Collection generateCRLs(InputStream inStream)
-            throws CRLException {
-        return spiImpl.engineGenerateCRLs(inStream);
-    }
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package java.security.cert;
+
+import java.io.InputStream;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.Security;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.harmony.security.fortress.Engine;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * 
+ */
+
+public class CertificateFactory {
+
+    // Store CertificateFactory service name
+    private static final String SERVICE = "CertificateFactory";
+
+    // Used to access common engine functionality
+    private static Engine engine = new Engine(SERVICE);
+
+    // Store used provider
+    private final Provider provider;
+
+    // Store used CertificateFactorySpi implementation
+    private final CertificateFactorySpi spiImpl;
+
+    // Store used type
+    private final String type;
+
+    /**
+     * @com.intel.drl.spec_ref
+     *  
+     */
+    protected CertificateFactory(CertificateFactorySpi certFacSpi,
+            Provider provider, String type) {
+        this.provider = provider;
+        this.type = type;
+        this.spiImpl = certFacSpi;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws CertificateException using NoSuchAlgorithmException information
+     * 
+     * throws NullPointerException if algorithm is null (instead of
+     * CertificateException as in 1.4 release)
+     */
+    public static final CertificateFactory getInstance(String type)
+            throws CertificateException {
+        if (type == null) {
+            throw new NullPointerException("type is null");
+        }
+        try {
+            synchronized (engine) {
+                engine.getInstance(type, null);
+                return new CertificateFactory((CertificateFactorySpi) engine.spi,
+                        engine.provider, type);
+            }
+        } catch (NoSuchAlgorithmException e) {
+            throw new CertificateException(e);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws NullPointerException if algorithm is null (instead of
+     * CertificateException as in 1.4 release)
+     */
+    public static final CertificateFactory getInstance(String type,
+            String provider) throws CertificateException,
+            NoSuchProviderException {
+        if ((provider == null) || (provider.length() == 0)) {
+            throw new IllegalArgumentException("Provider is null or empty");
+        }
+        Provider impProvider = Security.getProvider(provider);
+        if (impProvider == null) {
+            throw new NoSuchProviderException(provider);
+        }
+        return getInstance(type, impProvider);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * throws CertificateException using NoSuchAlgorithmException information
+     * 
+     * throws NullPointerException if algorithm is null (instead of
+     * CertificateException as in 1.4 release)
+     */
+    public static final CertificateFactory getInstance(String type,
+            Provider provider) throws CertificateException {
+        if (provider == null) {
+            throw new IllegalArgumentException("Provider is null");
+        }
+        if (type == null) {
+            throw new NullPointerException("type is null");
+        }
+        try {
+            synchronized (engine) {
+                engine.getInstance(type, provider, null);
+                return new CertificateFactory((CertificateFactorySpi) engine.spi,
+                        provider, type);
+            }
+        } catch (NoSuchAlgorithmException e) {
+            throw new CertificateException(e.getMessage());
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final Provider getProvider() {
+        return provider;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final String getType() {
+        return type;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final Certificate generateCertificate(InputStream inStream)
+            throws CertificateException {
+        return spiImpl.engineGenerateCertificate(inStream);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * FIXME: update to Iterator <String>getCertPathEncodings()
+     */
+    public final Iterator getCertPathEncodings() {
+        return spiImpl.engineGetCertPathEncodings();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final CertPath generateCertPath(InputStream inStream)
+            throws CertificateException {
+        Iterator it = getCertPathEncodings();
+        if (!it.hasNext()) {
+            throw new CertificateException("There are no CertPath encodings");
+        }
+        return spiImpl.engineGenerateCertPath(inStream, (String) it.next());
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final CertPath generateCertPath(InputStream inStream, String encoding)
+            throws CertificateException {
+        return spiImpl.engineGenerateCertPath(inStream, encoding);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * FIXME: update parameter to (List <? extends Certificate> certificates)
+     */
+    public final CertPath generateCertPath(List certificates)
+            throws CertificateException {
+        return spiImpl.engineGenerateCertPath(certificates);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * FIXME: update returned value to Collection <? extends Certificate>
+     */
+    public final Collection generateCertificates(InputStream inStream)
+            throws CertificateException {
+        return spiImpl.engineGenerateCertificates(inStream);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public final CRL generateCRL(InputStream inStream) throws CRLException {
+        return spiImpl.engineGenerateCRL(inStream);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * 
+     * FIXME: update returned value to Collection <? extends CRL>
+     */
+    public final Collection generateCRLs(InputStream inStream)
+            throws CRLException {
+        return spiImpl.engineGenerateCRLs(inStream);
+    }
 }



Mime
View raw message