public class RSAKeyValue extends KeyValue implements DSIGConstants
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALGORITHM_RSA |
private java.lang.String |
exponent |
private java.lang.String |
modulus |
private java.security.interfaces.RSAPublicKey |
publicKey |
private boolean |
validated |
ATTR_ALGORITHM, ATTR_ID, ATTR_PREFIX_LIST, ATTR_URI, ATTR_XMLNS, DSIG_PREFIX, DSIG_URI, DSIG_URI2, EXC_C14N_DEFAULT_PREFIX, TAG_C14N_METHOD, TAG_DIGEST_METHOD, TAG_DIGEST_VALUE, TAG_DSA_G, TAG_DSA_KEY_VALUE, TAG_DSA_P, TAG_DSA_Q, TAG_DSA_Y, TAG_HMAC_OUTPUT_LENGTH, TAG_INCLUSIVE_NAMESPACES, TAG_KEY_INFO, TAG_KEY_NAME, TAG_KEY_VALUE, TAG_OBJECT, TAG_REFERENCE, TAG_RSA_EXPONENT, TAG_RSA_KEY_VALUE, TAG_RSA_MODULUS, TAG_SIGNATURE, TAG_SIGNATURE_METHOD, TAG_SIGNATURE_VALUE, TAG_SIGNED_INFO, TAG_TRANSFORM, TAG_TRANSFORMS, TAG_X509_CERTIFICATE, TAG_X509_DATA, TAG_X509_ISSUER_NAME, TAG_X509_ISSUER_SERIAL, TAG_X509_SERIAL_NUMBER, TAG_X509_SUBJECT_NAME, TAG_XPATH, TC_C14N_METHOD, TC_DIGEST_METHOD, TC_DSA_KEY_VALUE, TC_KEY_INFO, TC_KEY_VALUE, TC_REFERENCE, TC_RSA_KEY_VALUE, TC_SIGNATURE, TC_SIGNATURE_METHOD, TC_SIGNED_INFO, TC_TRANSFORMS, TC_X509_DATA, VERBOSE, VERBOSE_PROPERTY, VERBOSE_PROPERTY_ALT
Constructor and Description |
---|
RSAKeyValue(java.security.interfaces.RSAPublicKey publicKey)
Creates a new
RSAKeyValue from a RSAPublicKey . |
RSAKeyValue(XMLInputStream in,
java.lang.String ns)
Deserializes a
RSAKeyValue by reading it from a stream. |
Modifier and Type | Method and Description |
---|---|
void |
fromXMLInternal(XMLInputStream in,
java.lang.String ns) |
private java.math.BigInteger |
getModulus() |
private java.math.BigInteger |
getPublicExponent() |
java.security.PublicKey |
getPublicKey()
Returns the
RSAPublicKey associated with this
RSAKeyValue . |
static void |
main(java.lang.String[] args) |
java.lang.String |
toString() |
void |
toXML(XMLOutputStream os,
java.lang.String ns,
int indent) |
void |
validate()
Validates the key.
|
createFromKeySpec, fromXML, getKeyValue
private static final java.lang.String ALGORITHM_RSA
private java.security.interfaces.RSAPublicKey publicKey
private boolean validated
private java.lang.String modulus
private java.lang.String exponent
public RSAKeyValue(java.security.interfaces.RSAPublicKey publicKey)
RSAKeyValue
from a RSAPublicKey
.
The new RSAKeyValue
is assumed to be validated.public RSAKeyValue(XMLInputStream in, java.lang.String ns) throws XMLStreamException
RSAKeyValue
by reading it from a stream.XMLStreamException
public java.security.PublicKey getPublicKey() throws KeyInfoValidationException
RSAPublicKey
associated with this
RSAKeyValue
. The RSAKeyValue
is validated
before the PublicKey
is returned.getPublicKey
in class KeyValue
KeyInfoValidationException
- If there was a problem creating
the key, such as a validation
failure.private java.math.BigInteger getModulus()
private java.math.BigInteger getPublicExponent()
public void validate() throws KeyInfoValidationException
validate
in class KeyValue
KeyInfoValidationException
public java.lang.String toString()
toString
in class java.lang.Object
public void toXML(XMLOutputStream os, java.lang.String ns, int indent) throws XMLStreamException
toXML
in class KeyValue
XMLStreamException
public void fromXMLInternal(XMLInputStream in, java.lang.String ns) throws XMLStreamException
XMLStreamException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception