FileDocCategorySizeDatePackage
DefaultKeys.javaAPI DocAndroid 1.5 API35287Wed May 06 22:41:06 BST 2009tests.targets.security

DefaultKeys

public class DefaultKeys extends Object

Fields Summary
private static final byte[]
RSA_private
private static final byte[]
RSA_public
private static final byte[]
DSA_private
private static final byte[]
DSA_public
private static final byte[]
DH_private
private static final byte[]
DH_public
private static final HashMap
keys
Constructors Summary
Methods Summary
public static java.security.PrivateKeygetPrivateKey(java.lang.String algorithmName)

     
        keys.put("DH_public", new X509EncodedKeySpec(DH_public));
        keys.put("DH_private", new PKCS8EncodedKeySpec(DH_private));
        keys.put("DSA_public", new X509EncodedKeySpec(DSA_public));
        keys.put("DSA_private", new PKCS8EncodedKeySpec(DSA_private));
        keys.put("RSA_public", new X509EncodedKeySpec(RSA_public));
        keys.put("RSA_private", new PKCS8EncodedKeySpec(RSA_private));
    
        KeyFactory factory = KeyFactory.getInstance(algorithmName);
        return factory.generatePrivate(keys.get(algorithmName + "_private"));
    
public static java.security.PublicKeygetPublicKey(java.lang.String algorithmName)

        KeyFactory factory = KeyFactory.getInstance(algorithmName);
        return factory.generatePublic(keys.get(algorithmName + "_public"));