FileDocCategorySizeDatePackage
RSAUtil.javaAPI DocAndroid 1.5 API1791Wed May 06 22:41:06 BST 2009org.bouncycastle.jce.provider

RSAUtil

public class RSAUtil extends Object
utility class for converting java.security RSA objects into their org.bouncycastle.crypto counterparts.

Fields Summary
Constructors Summary
Methods Summary
static org.bouncycastle.crypto.params.RSAKeyParametersgeneratePrivateKeyParameter(java.security.interfaces.RSAPrivateKey key)

        if (key instanceof RSAPrivateCrtKey)
        {
            RSAPrivateCrtKey    k = (RSAPrivateCrtKey)key;

            return new RSAPrivateCrtKeyParameters(k.getModulus(),
                k.getPublicExponent(), k.getPrivateExponent(),
                k.getPrimeP(), k.getPrimeQ(), k.getPrimeExponentP(),                            k.getPrimeExponentQ(), k.getCrtCoefficient());
        }
        else
        {
            RSAPrivateKey    k = key;

            return new RSAKeyParameters(true, k.getModulus(), k.getPrivateExponent());
        }
    
static org.bouncycastle.crypto.params.RSAKeyParametersgeneratePublicKeyParameter(java.security.interfaces.RSAPublicKey key)

        return new RSAKeyParameters(false, key.getModulus(), key.getPublicExponent());

    
static booleanisRsaOid(org.bouncycastle.asn1.DERObjectIdentifier algOid)

        return algOid.equals(PKCSObjectIdentifiers.rsaEncryption)
            || algOid.equals(X509ObjectIdentifiers.id_ea_rsa)
            || algOid.equals(PKCSObjectIdentifiers.id_RSASSA_PSS)
            || algOid.equals(PKCSObjectIdentifiers.id_RSAES_OAEP);