Package javax.xml.crypto

Examples of javax.xml.crypto.KeySelectorResult


      {
        if (xmlStructure instanceof X509Data)
        {
          final Certificate certificate = (Certificate)((X509Data)xmlStructure).getContent().get(0);
          return
            new KeySelectorResult()
            {
              @Override
              public Key getKey()
              {
                return certificate.getPublicKey();
              }
            }
          ;
        }
        if (xmlStructure instanceof KeyValue)
        {
          try
          {
            final PublicKey publicKey = ((KeyValue)xmlStructure).getPublicKey();
            return
            new KeySelectorResult()
            {
              @Override
              public Key getKey()
              {
                return publicKey;
View Full Code Here


                } else if (xmlStructure instanceof JAXBStructure) {
                    JAXBElement reference = ((JAXBStructure) xmlStructure).getJAXBElement();
                    if (isSecurityTokenReference(reference)) {
                        isStr = true;
                        final Key key = resolve(reference, context, purpose);
                        return new KeySelectorResult() {

                            public Key getKey() {
                                return key;
                            }
                        };
View Full Code Here

    String getAlias() {
        return keyStoreAndAlias.getAlias();
    }

    private KeySelectorResult getKeySelectorResult(final Key key) {
        return new KeySelectorResult() {
            public Key getKey() {
                return key;
            }
        };
    }
View Full Code Here

        };
    }

    private KeySelectorResult getNullKeyResult() {
        if (nullKeyResult == null) {
            nullKeyResult = new KeySelectorResult() {
                public Key getKey() {
                    return null;
                }
            };
        }
View Full Code Here

                } else if(xmlStructure instanceof DOMStructure) {
                    SOAPElement reference = (SOAPElement)((DOMStructure)xmlStructure).getNode();
                    if(isSecurityTokenReference(reference)){
                        isStr = true;
                        final Key key = resolve(reference, context, purpose);
                        return new KeySelectorResult(){
                            public Key getKey(){
                                return key;
                            }
                        };
                    }
View Full Code Here

                } else if (xmlStructure instanceof JAXBStructure) {
                    JAXBElement reference = ((JAXBStructure) xmlStructure).getJAXBElement();
                    if (isSecurityTokenReference(reference)) {
                        isStr = true;
                        final Key key = resolve(reference, context, purpose);
                        return new KeySelectorResult() {

                            public Key getKey() {
                                return key;
                            }
                        };
View Full Code Here

        si.setSignedInfo(_streamSI);

        // si.setCanonicalizedSI(signedInfoBytes);
       

        KeySelectorResult keySelectoResult = null;
        try {
            sm = si.getSignatureMethod();
            if(verificationKey == null){
                keySelectoResult = xMLValidateContext.getKeySelector().select(getKeyInfo(),KeySelector.Purpose.VERIFY,sm,xMLValidateContext);
                verificationKey = keySelectoResult.getKey();
            }
            if (verificationKey == null) {
                throw new XMLSignatureException("The KeySelector"+ xMLValidateContext.getKeySelector()+ " did not " +
                          "find the key used for signature verification");
            }
View Full Code Here

            ref.digest(xMLSignContext);
        }


        Key signingKey = null;
        KeySelectorResult keySelectoResult = null;
        try {
            sm = si.getSignatureMethod();
            keySelectoResult = xMLSignContext.getKeySelector().select(getKeyInfo(),KeySelector.Purpose.SIGN,sm,xMLSignContext);
            signingKey = keySelectoResult.getKey();
            if (signingKey == null) {
                throw new XMLSignatureException("The KeySelector"+ xMLSignContext.getKeySelector()+ " did not " +
                          "find the key used for signing");
            }
        } catch (KeySelectorException kse) {
View Full Code Here

TOP

Related Classes of javax.xml.crypto.KeySelectorResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.