Code example for ECPrivateKey

Methods: getParams, getS

0
    } 
 
    public static OpenSSLKey getInstance(ECPrivateKey ecPrivateKey) throws InvalidKeyException {
        try { 
            OpenSSLECGroupContext group = OpenSSLECGroupContext.getInstance(ecPrivateKey
                    .getParams());
            final BigInteger privKey = ecPrivateKey.getS();
            return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(), 0,
                    privKey.toByteArray()));
        } catch (Exception e) {
            throw new InvalidKeyException(e);
        } 
    } 
 
    @Override 
    public String getAlgorithm() {
        return ALGORITHM;
    } 
 
    @Override 
    public String getFormat() {