Class X509DataOnlyKeySelector
- java.lang.Object
-
- javax.xml.crypto.KeySelector
-
- org.certificateservices.messages.csmessages.X509DataOnlyKeySelector
-
- Direct Known Subclasses:
X509DataOnlyKeySelector
public class X509DataOnlyKeySelector extends javax.xml.crypto.KeySelectorSpecial version of a key selector that only supports one X509Data containing exactly one X509Certificate and returns it if it's valid and authorized.It also contains a help method to return the X509Certificate in
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.logging.Loggerlogprotected MessageSecurityProviderpkiMessageSecurityProvider
-
Constructor Summary
Constructors Constructor Description X509DataOnlyKeySelector(MessageSecurityProvider pkiMessageSecurityProvider)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.crypto.KeySelectorResultselect(javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo, javax.xml.crypto.KeySelector.Purpose purpose, javax.xml.crypto.AlgorithmMethod method, javax.xml.crypto.XMLCryptoContext context)Finds a certificate from the key info part of the signed message and checks it with the security provider if it's valid and authorized.
-
-
-
Field Detail
-
log
protected static java.util.logging.Logger log
-
pkiMessageSecurityProvider
protected MessageSecurityProvider pkiMessageSecurityProvider
-
-
Constructor Detail
-
X509DataOnlyKeySelector
public X509DataOnlyKeySelector(MessageSecurityProvider pkiMessageSecurityProvider)
Default constructor.- Parameters:
pkiMessageSecurityProvider- the provider to use.
-
-
Method Detail
-
select
public javax.xml.crypto.KeySelectorResult select(javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo, javax.xml.crypto.KeySelector.Purpose purpose, javax.xml.crypto.AlgorithmMethod method, javax.xml.crypto.XMLCryptoContext context) throws javax.xml.crypto.KeySelectorExceptionFinds a certificate from the key info part of the signed message and checks it with the security provider if it's valid and authorized.- Specified by:
selectin classjavax.xml.crypto.KeySelector- Parameters:
keyInfo- aKeyInfo(may benull)purpose- the key's purposemethod- the algorithm method that this key is to be used for. Only keys that are compatible with the algorithm and meet the constraints of the specified algorithm should be returned.context- anXMLCryptoContextthat may contain additional useful information for finding an appropriate key- Returns:
- a key selector result
- Throws:
javax.xml.crypto.KeySelectorException- if an exceptional condition occurs while attempting to find a key. Note that an inability to find a key is not considered an exception (nullshould be returned in that case). However, an error condition (ex: network communications failure) that prevented theKeySelectorfrom finding a potential key should be considered an exception.java.lang.ClassCastException- if the data type ofmethodis not supported by this key selector
-
-