Class HolderOfKeySubjectConfirmationValidator

    • Field Detail

      • log

        private org.slf4j.Logger log
        Class logger.
    • Constructor Detail

      • HolderOfKeySubjectConfirmationValidator

        public HolderOfKeySubjectConfirmationValidator()
    • Method Detail

      • getServicedMethod

        @Nonnull
        public String getServicedMethod()
      • isValidConfirmationDataType

        protected boolean isValidConfirmationDataType​(@Nonnull
                                                      SubjectConfirmation confirmation)
                                               throws AssertionValidationException
        Checks to see whether the schema type of the subject confirmation data, if present, is the required KeyInfoConfirmationDataType.TYPE_NAME.
        Parameters:
        confirmation - subject confirmation bearing the confirmation data to be checked
        Returns:
        true if the confirmation data's schema type is correct, false otherwise
        Throws:
        AssertionValidationException - thrown if there is a problem validating the confirmation data type
      • getSubjectConfirmationKeyInformation

        @Nonnull
        protected List<KeyInfo> getSubjectConfirmationKeyInformation​(@Nonnull
                                                                     SubjectConfirmation confirmation,
                                                                     @Nonnull
                                                                     Assertion assertion,
                                                                     @Nonnull
                                                                     ValidationContext context)
                                                              throws AssertionValidationException
        Extracts the KeyInfos from the given subject confirmation data.
        Parameters:
        confirmation - subject confirmation data
        assertion - assertion bearing the subject to be confirmed
        context - current message processing context
        Returns:
        list of key informations available in the subject confirmation data, never null
        Throws:
        AssertionValidationException - if there is a problem processing the SubjectConfirmation
      • matchesKeyValue

        protected boolean matchesKeyValue​(@Nullable
                                          PublicKey key,
                                          @Nonnull
                                          KeyInfo keyInfo)
                                   throws AssertionValidationException
        Checks whether the supplied public key matches one of the keys in the given KeyInfo.

        Evaluates both KeyValue and DEREncodedKeyValue children of the KeyInfo.

        Matches are performed using Java equals() against PublicKeys decoded from the KeyInfo data.

        Parameters:
        key - public key presenter of the assertion
        keyInfo - key info from subject confirmation of the assertion
        Returns:
        true if the public key in the certificate matches one of the key values in the key info, false otherwise
        Throws:
        AssertionValidationException - thrown if there is a problem matching the key value
      • matchesKeyValue

        protected boolean matchesKeyValue​(@Nonnull
                                          PublicKey key,
                                          @Nullable
                                          List<KeyValue> keyValues)
        Checks whether the supplied public key matches one of the supplied KeyValue elements.

        Matches are performed using Java equals() against PublicKeys decoded from the KeyInfo data.

        Parameters:
        key - public key presenter of the assertion
        keyValues - candidate KeyValue elements
        Returns:
        true if the public key in the certificate matches one of the key values, false otherwise
      • matchesDEREncodedKeyValue

        protected boolean matchesDEREncodedKeyValue​(@Nonnull
                                                    PublicKey key,
                                                    @Nullable
                                                    List<DEREncodedKeyValue> derEncodedKeyValues)
        Checks whether the supplied public key matches one of the supplied DEREncodedKeyValue elements.

        Matches are performed using Java equals() against PublicKeys decoded from the KeyInfo data.

        Parameters:
        key - public key presenter of the assertion
        derEncodedKeyValues - candidate DEREncodedKeyValue elements
        Returns:
        true if the public key in the certificate matches one of the DER-encoded key values, false otherwise
      • matchesX509Certificate

        protected boolean matchesX509Certificate​(@Nullable
                                                 X509Certificate cert,
                                                 @Nonnull
                                                 KeyInfo keyInfo)
                                          throws AssertionValidationException
        Checks whether the presenter's certificate matches a certificate described by the X509Data within the KeyInfo.

        Matches are performed using Java equals() against X509Certificates decoded from the KeyInfo data.

        Parameters:
        cert - certificate of the presenter of the assertion
        keyInfo - key info from subject confirmation of the assertion
        Returns:
        true if the presenter's certificate matches the key described by an X509Data within the KeyInfo, false otherwise.
        Throws:
        AssertionValidationException - thrown if there is a problem matching the certificate