FileDocCategorySizeDatePackage
EncryptedPrivateKeyInfoData.javaAPI DocAndroid 1.5 API88276Wed May 06 22:41:02 BST 2009org.apache.harmony.crypto.tests.support

EncryptedPrivateKeyInfoData

public class EncryptedPrivateKeyInfoData extends Object
Support class for EncryptedPrivateKeyInfo_ImplTest and EncryptedPrivateKeyInfo_Test All binary data for these tests were generated using BEA JRockit j2sdk1.4.2_04 (http://www.bea.com) with security providers list extended by Bouncy Castle's one (http://www.bouncycastle.org)

Fields Summary
private static final byte[]
dsaEncryptedPrivateKeyInfo
"valid" encoding for DSA with alg params
private static final byte[]
dsaEncryptedPrivateKeyInfoNP
"valid" encoding for DSA - no alg params
private static final byte[]
dhEncryptedPrivateKeyInfo
"valid" encoding for DH with alg params
private static final byte[]
dhEncryptedPrivateKeyInfoNP
"valid" encoding for DH - no alg params
private static final byte[]
dsaParamsEncoded
Valid DSA parameters encoding
private static final byte[]
dhParamsEncoded
Valid DH parameters encoding
public static final byte[]
encryptedData
pretends to be encrypted private key
private static final HashMap
validEPKIEncodings
private static final HashMap
validEPKIEncodingsNP
private static final HashMap
validAPEncodings
public static final String[]
algName0
Algorithm_names/standard_names to be used in tests "DSA" and "DH" must be always presented
Constructors Summary
Methods Summary
public static byte[]getParametersEncoding(java.lang.String algName)
Returns valid encoding of EncryptedPrivateKeyInfo However encoded private key field (encryptedData) does not contain valid encrypted data.

throws
NoSuchAlgorithmException

        String algNameUC = algName.toUpperCase();
        byte[] ret = validAPEncodings.get(algNameUC);
        if (ret != null) {
            return ret;
        }
        throw new NoSuchAlgorithmException("No AP encoding available for "
                + algName);
    
public static byte[]getValidEncryptedPrivateKeyInfoEncoding(java.lang.String algName, boolean includingAlgParameters)
Returns valid encoding of EncryptedPrivateKeyInfo However encoded private key field (encryptedData) does not contain valid encrypted data.

throws
NoSuchAlgorithmException


                             
       
               
              
        String algNameUC = algName.toUpperCase();
        byte[] ret = includingAlgParameters ? validEPKIEncodings
                .get(algNameUC) : validEPKIEncodingsNP.get(algNameUC);
        if (ret != null) {
            return ret.clone();
        }
        throw new NoSuchAlgorithmException("No encoding available for "
                + algName);
    
public static byte[]getValidEncryptedPrivateKeyInfoEncoding(java.lang.String algName)

        return getValidEncryptedPrivateKeyInfoEncoding(algName, true);