Class X509DataOnlyKeySelector

  • Direct Known Subclasses:
    X509DataOnlyKeySelector

    public class X509DataOnlyKeySelector
    extends javax.xml.crypto.KeySelector
    Special 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

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.xml.crypto.KeySelector

        javax.xml.crypto.KeySelector.Purpose
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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)
      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.
      • Methods inherited from class javax.xml.crypto.KeySelector

        singletonKeySelector
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        protected static java.util.logging.Logger log
    • 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.KeySelectorException
        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.
        Specified by:
        select in class javax.xml.crypto.KeySelector
        Parameters:
        keyInfo - a KeyInfo (may be null)
        purpose - the key's purpose
        method - 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 - an XMLCryptoContext that 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 (null should be returned in that case). However, an error condition (ex: network communications failure) that prevented the KeySelector from finding a potential key should be considered an exception.
        java.lang.ClassCastException - if the data type of method is not supported by this key selector