Search in sources :

Example 6 with DSAParameter

use of org.bouncycastle.asn1.x509.DSAParameter in project robovm by robovm.

the class AlgorithmParametersSpi method engineInit.

protected void engineInit(byte[] params) throws IOException {
    try {
        DSAParameter dsaP = DSAParameter.getInstance(ASN1Primitive.fromByteArray(params));
        currentSpec = new DSAParameterSpec(dsaP.getP(), dsaP.getQ(), dsaP.getG());
    } catch (ClassCastException e) {
        throw new IOException("Not a valid DSA Parameter encoding.");
    } catch (ArrayIndexOutOfBoundsException e) {
        throw new IOException("Not a valid DSA Parameter encoding.");
    }
}
Also used : DSAParameterSpec(java.security.spec.DSAParameterSpec) DSAParameter(org.bouncycastle.asn1.x509.DSAParameter) IOException(java.io.IOException)

Aggregations

DSAParameter (org.bouncycastle.asn1.x509.DSAParameter)6 BigInteger (java.math.BigInteger)5 DHParameter (org.bouncycastle.asn1.pkcs.DHParameter)4 AlgorithmIdentifier (org.bouncycastle.asn1.x509.AlgorithmIdentifier)4 X962Parameters (org.bouncycastle.asn1.x9.X962Parameters)4 X9ECParameters (org.bouncycastle.asn1.x9.X9ECParameters)4 DHParameters (org.bouncycastle.crypto.params.DHParameters)4 DSAParameters (org.bouncycastle.crypto.params.DSAParameters)4 ECDomainParameters (org.bouncycastle.crypto.params.ECDomainParameters)4 DERInteger (org.bouncycastle.asn1.DERInteger)3 IOException (java.io.IOException)2 ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)2 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)2 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)2 ASN1OctetString (org.bouncycastle.asn1.ASN1OctetString)2 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)2 DEREncodable (org.bouncycastle.asn1.DEREncodable)2 DERObjectIdentifier (org.bouncycastle.asn1.DERObjectIdentifier)2 DEROctetString (org.bouncycastle.asn1.DEROctetString)2 DHDomainParameters (org.bouncycastle.asn1.x9.DHDomainParameters)2