Example usage for org.bouncycastle.asn1.sec ECPrivateKey ECPrivateKey

List of usage examples for org.bouncycastle.asn1.sec ECPrivateKey ECPrivateKey

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.sec ECPrivateKey ECPrivateKey.

Prototype

public ECPrivateKey(int orderBitLength, BigInteger key, ASN1Encodable parameters) 

Source Link

Usage

From source file:edu.tamu.tcat.crypto.bouncycastle.ASN1SeqKeyImpl.java

License:Apache License

private static byte[] encodeECKey(java.security.interfaces.ECPrivateKey key) throws EncodingException {
    ASN1Sequence parameters = getParameters(key.getParams());
    DERBitString publicKey = getPublic(key);
    ECPrivateKey encoded = new ECPrivateKey(key.getS(), publicKey, parameters);
    try {//from  w w w . j a v  a 2 s.c o m
        return encoded.getEncoded();
    } catch (IOException e) {
        throw new EncodingException(e);
    }
}