List of usage examples for org.bouncycastle.asn1.sec ECPrivateKey getEncoded
public byte[] getEncoded() throws IOException
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 {//ww w. j a va 2s .co m return encoded.getEncoded(); } catch (IOException e) { throw new EncodingException(e); } }