FileDocCategorySizeDatePackage
RSAUtil.javaAPI DocAzureus 3.0.3.41305Tue Jun 08 05:12:56 BST 2004org.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
public 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());
        }
    
public static org.bouncycastle.crypto.params.RSAKeyParametersgeneratePublicKeyParameter(java.security.interfaces.RSAPublicKey key)

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