Results 1 to 2 of 2

Thread: Getting hold of the sign certificate

  1. #1
    Join Date
    Jun 2009
    Posts
    1

    Default Getting hold of the sign certificate

    I need to create an EndpointInterceptor that extracts the certificate used to validate the signature a in previoulsy executed wss4j-interceptor.
    Can the certificate be fetched from the MessageContext?

  2. #2

    Default

    Quote Originally Posted by kriand View Post
    I need to create an EndpointInterceptor that extracts the certificate used to validate the signature a in previoulsy executed wss4j-interceptor.
    Can the certificate be fetched from the MessageContext?
    If I am understanding what you are asking, Wss4jSecurityInterceptor seems to be doing just that. If you step through it, you can see it extract the certificate from the request.

    Code:
        protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext)
                throws WsSecurityValidationException {
            if (logger.isDebugEnabled()) {
                logger.debug("Validating message [" + soapMessage + "] with actions [" + validationActions + "]");
            }
    
            if (validationAction == WSConstants.NO_SECURITY) {
                return;
            }
    
            Document envelopeAsDocument = toDocument(soapMessage, messageContext);
    
            // Header processing
            WSSecurityEngine securityEngine = WSSecurityEngine.getInstance();
    
            try {
                Vector results = securityEngine
                        .processSecurityHeader(envelopeAsDocument, validationActor, validationCallbackHandler,
                                validationSignatureCrypto, validationDecryptionCrypto);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •