public class SPKAC
extends java.lang.Object
implements java.io.Externalizable
The SPKAC class can be used by the X509 class to generate X509 certificates.
Constructor and Description |
---|
SPKAC()
Creates a new empty instance.
|
SPKAC(KeyPair kp)
Creates a new SPKAC.
|
SPKAC(KeyPair kp,
RandomBitsSource rbs)
Creates a new SPKAC.
|
SPKAC(java.lang.String challenge,
KeyPair kp)
Creates a new SPKAC object with the specified challenge and key pair.
|
SPKAC(java.lang.String challenge,
KeyPair kp,
RandomBitsSource rbs) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getChallenge()
Returns the challenge string.
|
PublicKey |
getPublicKey()
Get the public key.
|
void |
input(java.io.InputStream is)
Inputs this SPKAC from a stream in binary DER-encoded form.
|
int |
length()
Returns length.
|
void |
output(java.io.OutputStream os)
Output to the specified output stream.
|
void |
readExternal(java.io.ObjectInput is) |
java.lang.String |
toBase64()
Converts this SPKAC into a base64-encoded string.
|
void |
writeExternal(java.io.ObjectOutput os) |
public SPKAC()
public SPKAC(KeyPair kp)
public SPKAC(KeyPair kp, RandomBitsSource rbs)
kp
- the key pairrbs
- the random bits source to be used for the signing
operation, if neededpublic SPKAC(java.lang.String challenge, KeyPair kp)
public SPKAC(java.lang.String challenge, KeyPair kp, RandomBitsSource rbs)
public PublicKey getPublicKey()
public java.lang.String getChallenge()
public void output(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void input(java.io.InputStream is) throws java.io.IOException
java.io.IOException
- if there was an I/O error, or the SPKAC is
invalid (e.g., the signature is incorrect, or the challenge does
not equal the expected value).public int length()
public java.lang.String toBase64() throws java.io.IOException
java.io.IOException
public void writeExternal(java.io.ObjectOutput os) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput is) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException