public class KeyPairUtils extends Object
KeyPair
.
Requires Bouncy Castle
. This class is part of the acme4j-utils
module.
Modifier and Type | Method and Description |
---|---|
static KeyPair |
createECKeyPair(String name)
Creates a new elliptic curve
KeyPair . |
static KeyPair |
createKeyPair(int keysize)
Creates a new RSA
KeyPair . |
static KeyPair |
readKeyPair(Reader r)
Reads a
KeyPair from a PEM file. |
static void |
writeKeyPair(KeyPair keypair,
Writer w)
Writes a
KeyPair PEM file. |
public static KeyPair createKeyPair(int keysize)
KeyPair
.keysize
- Key sizeKeyPair
public static KeyPair createECKeyPair(String name)
KeyPair
.name
- ECDSA curve name (e.g. "secp256r1")KeyPair
public static KeyPair readKeyPair(Reader r) throws IOException
KeyPair
from a PEM file.r
- Reader
to read the PEM file from. The Reader
is closed
after use.KeyPair
readIOException
public static void writeKeyPair(KeyPair keypair, Writer w) throws IOException
KeyPair
PEM file.keypair
- KeyPair
to writew
- Writer
to write the PEM file to. The Writer
is closed
after use.IOException
Copyright © 2015–2019. All rights reserved.