org.testifyproject.bouncycastle.operator.bc.BcRSAAsymmetricKeyWrapper Maven / Gradle / Ivy
The newest version!
package org.testifyproject.bouncycastle.operator.bc;
import java.io.IOException;
import org.testifyproject.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.testifyproject.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.testifyproject.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.testifyproject.bouncycastle.crypto.AsymmetricBlockCipher;
import org.testifyproject.bouncycastle.crypto.encodings.PKCS1Encoding;
import org.testifyproject.bouncycastle.crypto.engines.RSAEngine;
import org.testifyproject.bouncycastle.crypto.params.AsymmetricKeyParameter;
import org.testifyproject.bouncycastle.crypto.util.PublicKeyFactory;
public class BcRSAAsymmetricKeyWrapper
extends BcAsymmetricKeyWrapper
{
public BcRSAAsymmetricKeyWrapper(AlgorithmIdentifier encAlgId, AsymmetricKeyParameter publicKey)
{
super(encAlgId, publicKey);
}
public BcRSAAsymmetricKeyWrapper(AlgorithmIdentifier encAlgId, SubjectPublicKeyInfo publicKeyInfo)
throws IOException
{
super(encAlgId, PublicKeyFactory.createKey(publicKeyInfo));
}
protected AsymmetricBlockCipher createAsymmetricWrapper(ASN1ObjectIdentifier algorithm)
{
return new PKCS1Encoding(new RSAEngine());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy