public class KeyInfo extends SignatureElementProxy
lengthXXX()
methods provide access to the internal Key
objects:
KeyInfo
was constructed from an Element
(Signature verification), the lengthXXX()
methods searches
for child elements of ds:KeyInfo
for known types. KeyInfo
was constructed from scratch (during
Signature generation), the lengthXXX()
methods return the number
of XXXs
objects already passed to the KeyInfoaddXXX()
methods are used for adding Objects of the
appropriate type to the KeyInfo
. This is used during signature
generation.
The itemXXX(int i)
methods return the i'th object of the
corresponding type.
The containsXXX()
methods return whether the KeyInfo
contains the corresponding type.baseURI
Constructor and Description |
---|
KeyInfo(Document doc)
Constructor KeyInfo
|
KeyInfo(Element element,
String baseURI)
Constructor KeyInfo
|
Modifier and Type | Method and Description |
---|---|
void |
add(DEREncodedKeyValue derEncodedKeyValue)
Method add
|
void |
add(DSAKeyValue dsakeyvalue)
Method add
|
void |
add(EncryptedKey encryptedKey)
Method addEncryptedKey
|
void |
add(KeyInfoReference keyInfoReference)
Method add
|
void |
add(KeyName keyname)
Method add
|
void |
add(KeyValue keyvalue)
Method add
|
void |
add(MgmtData mgmtdata)
Method add
|
void |
add(PGPData pgpdata)
Method addPGPData
|
void |
add(PublicKey pk)
Method add
|
void |
add(RetrievalMethod retrievalmethod)
Method add
|
void |
add(RSAKeyValue rsakeyvalue)
Method add
|
void |
add(SPKIData spkidata)
Method add
|
void |
add(X509Data x509data)
Method addX509Data
|
void |
addDEREncodedKeyValue(PublicKey pk)
Method addDEREncodedKeyValue
|
void |
addKeyInfoReference(String URI)
Method addKeyInfoReference
|
void |
addKeyName(String keynameString)
Method addKeyName
|
void |
addKeyValue(Element unknownKeyValueElement)
Method addKeyValue
|
void |
addKeyValue(PublicKey pk)
Method addKeyValue
|
void |
addMgmtData(String mgmtdata)
Method addMgmtData
|
void |
addRetrievalMethod(String uri,
Transforms transforms,
String Type)
Method addRetrievalMethod
|
void |
addStorageResolver(StorageResolver storageResolver)
Method addStorageResolver
|
void |
addUnknownElement(Element element)
Method addUnknownElement
|
boolean |
containsDEREncodedKeyValue()
Method containsDEREncodedKeyValue
|
boolean |
containsKeyInfoReference()
Method containsKeyInfoReference
|
boolean |
containsKeyName()
Method containsKeyName
|
boolean |
containsKeyValue()
Method containsKeyValue
|
boolean |
containsMgmtData()
Method containsMgmtData
|
boolean |
containsPGPData()
Method containsPGPData
|
boolean |
containsRetrievalMethod()
Method containsRetrievalMethod
|
boolean |
containsSPKIData()
Method containsSPKIData
|
boolean |
containsUnknownElement()
Method containsUnknownElement
|
boolean |
containsX509Data()
Method containsX509Data
|
String |
getBaseLocalName()
Returns the localname of the Elements of the sub-class.
|
String |
getId()
Returns the
Id attribute |
PrivateKey |
getPrivateKey()
This method returns a private key.
|
PublicKey |
getPublicKey()
This method returns the public key.
|
SecretKey |
getSecretKey()
This method returns a secret (symmetric) key.
|
X509Certificate |
getX509Certificate()
Method getX509Certificate
|
boolean |
isEmpty()
Method isEmpty
|
DEREncodedKeyValue |
itemDEREncodedKeyValue(int i)
Method itemDEREncodedKeyValue
|
EncryptedKey |
itemEncryptedKey(int i)
Method itemEncryptedKey
|
KeyInfoReference |
itemKeyInfoReference(int i)
Method itemKeyInfoReference
|
KeyName |
itemKeyName(int i)
Method itemKeyName
|
KeyValue |
itemKeyValue(int i)
Method itemKeyValue
|
MgmtData |
itemMgmtData(int i)
Method itemMgmtData
|
PGPData |
itemPGPData(int i)
Method itemPGPData
|
RetrievalMethod |
itemRetrievalMethod(int i)
Method itemRetrievalMethod
|
SPKIData |
itemSPKIData(int i)
Method itemSPKIData
|
Element |
itemUnknownElement(int i)
Method itemUnknownElement
|
X509Data |
itemX509Data(int i)
Method itemX509Data
|
int |
lengthDEREncodedKeyValue()
Method lengthDEREncodedKeyValue
|
int |
lengthKeyInfoReference()
Method lengthKeyInfoReference
|
int |
lengthKeyName()
Method lengthKeyName
|
int |
lengthKeyValue()
Method lengthKeyValue
|
int |
lengthMgmtData()
Method lengthMgmtData
|
int |
lengthPGPData()
Method lengthPGPData
|
int |
lengthRetrievalMethod()
Method lengthRetrievalMethod
|
int |
lengthSPKIData()
Method lengthSPKIData
|
int |
lengthUnknownElement()
Method lengthUnknownElement
NOTE possibly buggy.
|
int |
lengthX509Data()
Method lengthX509Data
|
void |
registerInternalKeyResolver(KeyResolverSpi realKeyResolver)
This method is used to add a custom
KeyResolverSpi to a KeyInfo
object. |
void |
setId(String id)
Sets the
Id attribute |
void |
setSecureValidation(boolean secureValidation)
Set whether secure processing is enabled or not.
|
getBaseNamespace
addBase64Element, addBase64Text, addBigIntegerElement, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContext
public KeyInfo(Document doc)
doc
- public KeyInfo(Element element, String baseURI) throws XMLSecurityException
element
- baseURI
- XMLSecurityException
public void setSecureValidation(boolean secureValidation)
public void setId(String id)
Id
attributeid
- IDpublic String getId()
Id
attributeId
attributepublic void addKeyName(String keynameString)
keynameString
- public void add(KeyName keyname)
keyname
- public void addKeyValue(PublicKey pk)
pk
- public void addKeyValue(Element unknownKeyValueElement)
unknownKeyValueElement
- public void add(DSAKeyValue dsakeyvalue)
dsakeyvalue
- public void add(RSAKeyValue rsakeyvalue)
rsakeyvalue
- public void add(PublicKey pk)
pk
- public void add(KeyValue keyvalue)
keyvalue
- public void addMgmtData(String mgmtdata)
mgmtdata
- public void add(MgmtData mgmtdata)
mgmtdata
- public void add(PGPData pgpdata)
pgpdata
- public void addRetrievalMethod(String uri, Transforms transforms, String Type)
uri
- transforms
- Type
- public void add(RetrievalMethod retrievalmethod)
retrievalmethod
- public void add(SPKIData spkidata)
spkidata
- public void add(X509Data x509data)
x509data
- public void add(EncryptedKey encryptedKey) throws XMLEncryptionException
encryptedKey
- XMLEncryptionException
public void addDEREncodedKeyValue(PublicKey pk) throws XMLSecurityException
pk
- XMLSecurityException
public void add(DEREncodedKeyValue derEncodedKeyValue)
derEncodedKeyValue
- public void addKeyInfoReference(String URI) throws XMLSecurityException
URI
- XMLSecurityException
public void add(KeyInfoReference keyInfoReference)
keyInfoReference
- public void addUnknownElement(Element element)
element
- public int lengthKeyName()
public int lengthKeyValue()
public int lengthMgmtData()
public int lengthPGPData()
public int lengthRetrievalMethod()
public int lengthSPKIData()
public int lengthX509Data()
public int lengthDEREncodedKeyValue()
public int lengthKeyInfoReference()
public int lengthUnknownElement()
public KeyName itemKeyName(int i) throws XMLSecurityException
i
- XMLSecurityException
public KeyValue itemKeyValue(int i) throws XMLSecurityException
i
- XMLSecurityException
public MgmtData itemMgmtData(int i) throws XMLSecurityException
i
- XMLSecurityException
public PGPData itemPGPData(int i) throws XMLSecurityException
i
- XMLSecurityException
public RetrievalMethod itemRetrievalMethod(int i) throws XMLSecurityException
i
- XMLSecurityException
public SPKIData itemSPKIData(int i) throws XMLSecurityException
i
- XMLSecurityException
public X509Data itemX509Data(int i) throws XMLSecurityException
i
- XMLSecurityException
public EncryptedKey itemEncryptedKey(int i) throws XMLSecurityException
i
- XMLSecurityException
public DEREncodedKeyValue itemDEREncodedKeyValue(int i) throws XMLSecurityException
i
- XMLSecurityException
public KeyInfoReference itemKeyInfoReference(int i) throws XMLSecurityException
i
- XMLSecurityException
public Element itemUnknownElement(int i)
i
- indexpublic boolean isEmpty()
public boolean containsKeyName()
public boolean containsKeyValue()
public boolean containsMgmtData()
public boolean containsPGPData()
public boolean containsRetrievalMethod()
public boolean containsSPKIData()
public boolean containsUnknownElement()
public boolean containsX509Data()
public boolean containsDEREncodedKeyValue()
public boolean containsKeyInfoReference()
public PublicKey getPublicKey() throws KeyResolverException
KeyResolverException
public X509Certificate getX509Certificate() throws KeyResolverException
KeyResolverException
public SecretKey getSecretKey() throws KeyResolverException
KeyResolverException
public PrivateKey getPrivateKey() throws KeyResolverException
KeyResolverException
public void registerInternalKeyResolver(KeyResolverSpi realKeyResolver)
KeyResolverSpi
to a KeyInfo
object.realKeyResolver
- public void addStorageResolver(StorageResolver storageResolver)
storageResolver
- public String getBaseLocalName()
getBaseLocalName
in class ElementProxy
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.