net.ripe.rpki.commons.crypto.util
Class KeyPairFactory

java.lang.Object
  extended by net.ripe.rpki.commons.crypto.util.KeyPairFactory

public class KeyPairFactory
extends Object


Field Summary
static String ALGORITHM
           
static BigInteger PUBLIC_EXPONENT
          F4 Public Exponent
static int RPKI_KEY_PAIR_SIZE
           
 
Constructor Summary
KeyPairFactory(String provider)
           
 
Method Summary
static PrivateKey decodePrivateKey(byte[] encoded)
          Decodes a PKCS#8 encoded private key.
static PublicKey decodePublicKey(byte[] encoded)
          Decodes an X.509 encoded public key.
 KeyPair generate()
           
 KeyPairFactory withProvider(String provider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALGORITHM

public static final String ALGORITHM
See Also:
Constant Field Values

RPKI_KEY_PAIR_SIZE

public static final int RPKI_KEY_PAIR_SIZE
See Also:
Constant Field Values

PUBLIC_EXPONENT

public static final BigInteger PUBLIC_EXPONENT
F4 Public Exponent

Constructor Detail

KeyPairFactory

public KeyPairFactory(String provider)
Method Detail

generate

public KeyPair generate()

decodePublicKey

public static PublicKey decodePublicKey(byte[] encoded)
Decodes an X.509 encoded public key.

Parameters:
encoded - the encoded public key.
Returns:
the PublicKey.

decodePrivateKey

public static PrivateKey decodePrivateKey(byte[] encoded)
Decodes a PKCS#8 encoded private key. This is the default encoding for the private key getEncoded method.

Parameters:
encoded - the encoded data.
Returns:
the PrivateKey.

withProvider

public KeyPairFactory withProvider(String provider)


Copyright © 2008-2015 RIPE NCC, the Netherlands. All Rights Reserved.