public class KeyInfo extends Object implements DSIGConstants
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| Modifier and Type | Method and Description |
|---|---|
void |
addEncryptedKey(EncryptedKey encryptedKey)
Adds an
EncryptedKey to the KeyInfo element. |
void |
addKeyName(String keyName)
Adds a KeyName to the KeyInfo element.
|
void |
addKeyValue(KeyValue keyValue)
Adds a KeyValue to the KeyInfo element.
|
void |
addSecurityTokenReference(SecurityTokenReference ref)
Adds an
SecurityTokenReference to the KeyInfo element. |
void |
addSecurityTokenReference(Token token) |
void |
addX509Data(X509Data x509Data)
Adds an
X509Data to the KeyInfo element. |
Iterator |
getCertificates()
Gets all of the
Certificate contained in this
KeyInfo. |
Iterator |
getEncryptedKeys() |
String |
getKeyName() |
Iterator |
getKeyNames() |
Iterator |
getKeyValues() |
Iterator |
getPublicKeys()
Returns the
PublicKeys contained in the KeyInfo
element. |
Iterator |
getSecurityTokenReferences() |
Iterator |
getSubjectNames()
Gets all of the
Certificate contained in this
KeyInfo. |
Iterator |
getX509Data() |
static void |
main(String[] args) |
void |
removeEncryptedKey(EncryptedKey encryptedKey)
Removes an EncryptedKey from the KeyInfo element.
|
void |
removeKeyName(String keyName)
Removes a KeyName from the KeyInfo element.
|
void |
removeKeyValue(KeyValue keyValue)
Removes a KeyValue from the KeyInfo element.
|
void |
removeSecurityTokenReference(SecurityTokenReference ref)
Removes a SecurityTokenReference from the KeyInfo element.
|
void |
removeX509Data(X509Data x509Data)
Removes a KeyValue from the KeyInfo element.
|
String |
toString() |
void |
toXML(XMLOutputStream os,
int indent) |
void |
toXML(XMLOutputStream os,
String ns,
int indent) |
void |
validate() |
public void addKeyName(String keyName)
public void removeKeyName(String keyName)
public String getKeyName()
public Iterator getKeyNames()
public void addKeyValue(KeyValue keyValue)
public void removeKeyValue(KeyValue keyValue)
public Iterator getKeyValues()
public void addX509Data(X509Data x509Data)
X509Data to the KeyInfo element.public void removeX509Data(X509Data x509Data)
public Iterator getX509Data()
public void addEncryptedKey(EncryptedKey encryptedKey)
EncryptedKey to the KeyInfo element.public void removeEncryptedKey(EncryptedKey encryptedKey)
public Iterator getEncryptedKeys()
public void addSecurityTokenReference(SecurityTokenReference ref)
SecurityTokenReference to the KeyInfo element.public void addSecurityTokenReference(Token token)
public void removeSecurityTokenReference(SecurityTokenReference ref)
public Iterator getSecurityTokenReferences()
public Iterator getSubjectNames() throws KeyInfoValidationException
Certificate contained in this
KeyInfo.Certificate, or null if this
KeyInfo contains no certificatesKeyInfoValidationExceptionpublic Iterator getCertificates() throws KeyInfoValidationException
Certificate contained in this
KeyInfo.Certificate, or null if this
KeyInfo contains no certificatesKeyInfoValidationExceptionpublic Iterator getPublicKeys() throws KeyInfoValidationException
PublicKeys contained in the KeyInfo
element.
NOTE: This PublicKey should not be used to perform
signature validation since there is no way to verify that the
key is valid. Instead, use the PublicKey contained in the
certificate, if one is available.KeyInfoValidationExceptionpublic void validate()
throws KeyInfoValidationException
KeyInfoValidationExceptionpublic void toXML(XMLOutputStream os, int indent) throws XMLStreamException
XMLStreamExceptionpublic void toXML(XMLOutputStream os, String ns, int indent) throws XMLStreamException
XMLStreamException