/** * construct an RSA key from a private key info object. */ JCERSAPrivateCrtKey( PrivateKeyInfo info) throws IOException { this(org.spongycastle.asn1.pkcs.RSAPrivateKey.getInstance(info.parsePrivateKey())); }
/** * construct an RSA key from a private key info object. */ JCERSAPrivateCrtKey( PrivateKeyInfo info) throws IOException { this(org.spongycastle.asn1.pkcs.RSAPrivateKey.getInstance(info.parsePrivateKey())); }
/** * construct an RSA key from a private key info object. */ BCRSAPrivateCrtKey( PrivateKeyInfo info) throws IOException { this(RSAPrivateKey.getInstance(info.parsePrivateKey())); }
/** * construct an RSA key from a private key info object. */ BCRSAPrivateCrtKey( PrivateKeyInfo info) throws IOException { this(RSAPrivateKey.getInstance(info.parsePrivateKey())); }
/** * @deprecated use parsePrivateKey() */ public ASN1Primitive getPrivateKey() { try { return parsePrivateKey().toASN1Primitive(); } catch (IOException e) { throw new IllegalStateException("unable to parse private key"); } }
/** * @deprecated use parsePrivateKey() */ public ASN1Primitive getPrivateKey() { try { return parsePrivateKey().toASN1Primitive(); } catch (IOException e) { throw new IllegalStateException("unable to parse private key"); } }
public BCNHPrivateKey(PrivateKeyInfo keyInfo) throws IOException { this.params = new NHPrivateKeyParameters(convert(ASN1OctetString.getInstance(keyInfo.parsePrivateKey()).getOctets())); }
BCGOST3410PrivateKey( PrivateKeyInfo info) throws IOException { GOST3410PublicKeyAlgParameters params = new GOST3410PublicKeyAlgParameters((ASN1Sequence)info.getAlgorithmId().getParameters()); ASN1OctetString derX = ASN1OctetString.getInstance(info.parsePrivateKey()); byte[] keyEnc = derX.getOctets(); byte[] keyBytes = new byte[keyEnc.length]; for (int i = 0; i != keyEnc.length; i++) { keyBytes[i] = keyEnc[keyEnc.length - 1 - i]; // was little endian } this.x = new BigInteger(1, keyBytes); this.gost3410Spec = GOST3410ParameterSpec.fromPublicKeyAlg(params); }
public BCDSAPrivateKey( PrivateKeyInfo info) throws IOException { DSAParameter params = DSAParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters()); ASN1Integer derX = (ASN1Integer)info.parsePrivateKey(); this.x = derX.getValue(); this.dsaSpec = new DSAParameterSpec(params.getP(), params.getQ(), params.getG()); }
BCElGamalPrivateKey( PrivateKeyInfo info) throws IOException { ElGamalParameter params = ElGamalParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters()); ASN1Integer derX = ASN1Integer.getInstance(info.parsePrivateKey()); this.x = derX.getValue(); this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG()); }
JCEElGamalPrivateKey( PrivateKeyInfo info) throws IOException { ElGamalParameter params = ElGamalParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters()); ASN1Integer derX = ASN1Integer.getInstance(info.parsePrivateKey()); this.x = derX.getValue(); this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG()); }
public BCSphincs256PrivateKey(PrivateKeyInfo keyInfo) throws IOException { this.treeDigest = SPHINCS256KeyParams.getInstance(keyInfo.getPrivateKeyAlgorithm().getParameters()).getTreeDigest().getAlgorithm(); this.params = new SPHINCSPrivateKeyParameters(ASN1OctetString.getInstance(keyInfo.parsePrivateKey()).getOctets()); }
public PrivateKey generatePrivate(PrivateKeyInfo keyInfo) throws IOException { RainbowPrivateKey pKey = RainbowPrivateKey.getInstance(keyInfo.parsePrivateKey()); return new BCRainbowPrivateKey(pKey.getInvA1(), pKey.getB1(), pKey.getInvA2(), pKey.getB2(), pKey.getVi(), pKey.getLayers()); }
public BCDSAPrivateKey( PrivateKeyInfo info) throws IOException { DSAParameter params = DSAParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters()); ASN1Integer derX = (ASN1Integer)info.parsePrivateKey(); this.x = derX.getValue(); this.dsaSpec = new DSAParameterSpec(params.getP(), params.getQ(), params.getG()); }
JCEElGamalPrivateKey( PrivateKeyInfo info) throws IOException { ElGamalParameter params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters()); DERInteger derX = ASN1Integer.getInstance(info.parsePrivateKey()); this.x = derX.getValue(); this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG()); }
BCElGamalPrivateKey( PrivateKeyInfo info) throws IOException { ElGamalParameter params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters()); DERInteger derX = ASN1Integer.getInstance(info.parsePrivateKey()); this.x = derX.getValue(); this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG()); }
JDKDSAPrivateKey( PrivateKeyInfo info) throws IOException { DSAParameter params = new DSAParameter((ASN1Sequence)info.getAlgorithmId().getParameters()); DERInteger derX = ASN1Integer.getInstance(info.parsePrivateKey()); this.x = derX.getValue(); this.dsaSpec = new DSAParameterSpec(params.getP(), params.getQ(), params.getG()); }
JDKDSAPrivateKey( PrivateKeyInfo info) throws IOException { DSAParameter params = DSAParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters()); ASN1Integer derX = ASN1Integer.getInstance(info.parsePrivateKey()); this.x = derX.getValue(); this.dsaSpec = new DSAParameterSpec(params.getP(), params.getQ(), params.getG()); }
public PrivateKey generatePrivate(PrivateKeyInfo pki) throws IOException { // get the inner type inside the BIT STRING ASN1Primitive innerType = pki.parsePrivateKey().toASN1Primitive(); McElieceCCA2PrivateKey key = McElieceCCA2PrivateKey.getInstance(innerType); return new BCMcElieceCCA2PrivateKey(new McElieceCCA2PrivateKeyParameters(key.getN(), key.getK(), key.getField(), key.getGoppaPoly(), key.getP(), null)); }
public PrivateKey generatePrivate(PrivateKeyInfo pki) throws IOException { // get the inner type inside the BIT STRING ASN1Primitive innerType = pki.parsePrivateKey().toASN1Primitive(); McEliecePrivateKey key = McEliecePrivateKey.getInstance(innerType); return new BCMcEliecePrivateKey(new McEliecePrivateKeyParameters(key.getN(), key.getK(), key.getField(), key.getGoppaPoly(), key.getP1(), key.getP2(), key.getSInv())); }