FileDocCategorySizeDatePackage
Support_TestProvider.javaAPI DocAndroid 1.5 API5338Wed May 06 22:41:06 BST 2009tests.support

Support_TestProvider

public class Support_TestProvider extends Provider
This class implements a dummy provider.

Fields Summary
private static final long
serialVersionUID
private static final String
NAME
private static final double
VERSION
private static final String
INFO
Constructors Summary
public Support_TestProvider()
Constructs a new instance of the dummy provider.


                 
      
        super(NAME, VERSION, INFO);
        registerServices();
    
Methods Summary
private voidregisterServices()
Register the services the receiver provides.

        AccessController.doPrivileged(new PrivilegedAction<Void>() {
            public Void run() {
                // Digest engine
                put("MessageDigest.SHA",
                        "made.up.provider.name.MessageDigestSHA");
                put("MessageDigest.MD2",
                        "made.up.provider.name.MessageDigestMD2");
                // aliases
                put("Alg.Alias.MessageDigest.SHA1", "SHA");
                put("Alg.Alias.MessageDigest.SHA-1", "SHA");
                put("Alg.Alias.MessageDigest.OID.1.3.14.3.2.26", "SHA");
                put("Alg.Alias.MessageDigest.1.3.14.3.2.26", "SHA");

                // Algorithm parameter generator
                put("AlgorithmParameterGenerator.DSA",
                        "made.up.provider.name.AlgorithmParameterGeneratorDSA");

                // Algorithm parameters
                put("AlgorithmParameters.DSA",
                        "made.up.provider.name.AlgorithmParametersDSA");
                // aliases
                put("Alg.Alias.AlgorithmParameters.1.2.840.10040.4.1", "DSA");
                put("Alg.Alias.AlgorithmParameters.1.3.14.3.2.12", "DSA");

                // Key pair generator
                put("KeyPairGenerator.DSA",
                        "made.up.provider.name.KeyPairGeneratorDSA");
                // aliases
                put("Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1", "DSA");
                put("Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1", "DSA");
                put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSA");

                // Key factory
                put("KeyFactory.DSA", "made.up.provider.name.KeyFactoryDSA");
                put("KeyFactory.RSA", "made.up.provider.name.KeyFactoryRSA");
                // aliases
                put("Alg.Alias.KeyFactory.1.2.840.10040.4.1", "DSA");
                put("Alg.Alias.KeyFactory.1.3.14.3.2.12", "DSA");

                // Signature algorithm
                put("Signature.SHA1withDSA",
                        "made.up.provider.name.SignatureDSA");

                // aliases
                put("Alg.Alias.Signature.DSA", "SHA1withDSA");
                put("Alg.Alias.Signature.DSS", "SHA1withDSA");
                put("Alg.Alias.Signature.SHA/DSA", "SHA1withDSA");
                put("Alg.Alias.Signature.SHA1/DSA", "SHA1withDSA");
                put("Alg.Alias.Signature.SHA-1/DSA", "SHA1withDSA");
                put("Alg.Alias.Signature.SHAwithDSA", "SHA1withDSA");
                put("Alg.Alias.Signature.DSAwithSHA1", "SHA1withDSA");
                put("Alg.Alias.Signature.DSAWithSHA1", "SHA1withDSA");
                put("Alg.Alias.Signature.SHA-1withDSA", "SHA1withDSA");
                put("Alg.Alias.Signature.OID.1.2.840.10040.4.3", "SHA1withDSA");
                put("Alg.Alias.Signature.1.2.840.10040.4.3", "SHA1withDSA");
                put("Alg.Alias.Signature.1.3.14.3.2.13", "SHA1withDSA");
                put("Alg.Alias.Signature.1.3.14.3.2.27", "SHA1withDSA");
                put("Alg.Alias.Signature.OID.1.3.14.3.2.13", "SHA1withDSA");
                put("Alg.Alias.Signature.OID.1.3.14.3.2.27", "SHA1withDSA");

                put("KeyStore.PKCS#12/Netscape",
                        "tests.support.Support_DummyPKCS12Keystore");

                // Certificate
                put("CertificateFactory.X509",
                        "made.up.provider.name.CertificateFactoryX509");
                // aliases
                put("Alg.Alias.CertificateFactory.X.509", "X509");

                return null;
            }
        });