Package javax.xml.crypto.dsig

Examples of javax.xml.crypto.dsig.SignatureMethod


        Element siblingElement
    ) throws WSSecurityException {
        try {
            java.security.Key key =
                WSSecurityUtil.prepareSecretKey(sigAlgo, derivedKeyBytes);
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
View Full Code Here


            } else if (secretKey != null) {
                key = WSSecurityUtil.prepareSecretKey(sigAlgo, secretKey);
            } else {
                key = userCrypto.getPrivateKey(user, password);
            }
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
View Full Code Here

            if (secretKey == null) {
                key = crypto.getPrivateKey(user, password);
            } else {
                key = WSSecurityUtil.prepareSecretKey(sigAlgo, secretKey);
            }
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
View Full Code Here

     CanonicalizationMethod canonicalizationMethod
         = fac.newCanonicalizationMethod
         (canonicalizationMethodType, (C14NMethodParameterSpec) null);
    
     List<Reference> referenceList = Collections.singletonList(ref);
     SignatureMethod signatureMethodObj = fac.newSignatureMethod(signatureMethod, null);
     SignedInfo si =  fac.newSignedInfo (canonicalizationMethod, signatureMethodObj ,
                             referenceList)
    
     KeyInfoFactory kif = fac.getKeyInfoFactory();
     KeyValue kv = kif.newKeyValue(publicKey);
View Full Code Here

            final Reference ref = sigFactory.newReference("", sigFactory
                    .newDigestMethod(DigestMethod.SHA1, null), envelopedTransform,
                    null, null);

            // Create the SignatureMethod based on the type of key
            SignatureMethod signatureMethod;
            if (pubKey instanceof DSAPublicKey) {
                signatureMethod = sigFactory.newSignatureMethod(
                        SignatureMethod.DSA_SHA1, null);
            } else if (pubKey instanceof RSAPublicKey) {
                signatureMethod = sigFactory.newSignatureMethod(
View Full Code Here

     CanonicalizationMethod canonicalizationMethod
         = fac.newCanonicalizationMethod
         (canonicalizationMethodType, (C14NMethodParameterSpec) null);
    
     List<Reference> referenceList = Collections.singletonList(ref);
     SignatureMethod signatureMethodObj = fac.newSignatureMethod(signatureMethod, null);
     SignedInfo si =  fac.newSignedInfo (canonicalizationMethod, signatureMethodObj ,
                             referenceList)
    
     KeyInfoFactory kif = fac.getKeyInfoFactory();
     KeyValue kv = kif.newKeyValue(publicKey);
View Full Code Here

        }

        if (!(o instanceof SignatureMethod)) {
            return false;
        }
        SignatureMethod osm = (SignatureMethod)o;

        return (getAlgorithm().equals(osm.getAlgorithm()) &&
            paramsEqual(osm.getParameterSpec()));
    }
View Full Code Here

        DigestMethod digestMethod = this.xmlSignatureFactory.newDigestMethod(digestType, null);
        List<Transform> transforms = Collections.singletonList(this.xmlSignatureFactory.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null));
        Reference reference = this.xmlSignatureFactory.newReference(XMLSigner.REFERENCE_URI, digestMethod, transforms, null, null);

        CanonicalizationMethod canonicalizationMethod = this.xmlSignatureFactory.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, (C14NMethodParameterSpec) null);
        SignatureMethod signatureMethod = this.xmlSignatureFactory.newSignatureMethod(this.getSignatureDigestName(certificate.getSigAlgName()), null);

        this.signedInfo = this.xmlSignatureFactory.newSignedInfo(canonicalizationMethod, signatureMethod, Collections.singletonList(reference));

        KeyInfoFactory keyInfoFactory = this.xmlSignatureFactory.getKeyInfoFactory();
        KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
View Full Code Here

        DigestMethod digestMethod = this.xmlSignatureFactory.newDigestMethod(digestType, null);
        List<Transform> transforms = Collections.singletonList(this.xmlSignatureFactory.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null));
        Reference reference = this.xmlSignatureFactory.newReference(XMLSigner.REFERENCE_URI, digestMethod, transforms, null, null);

        CanonicalizationMethod canonicalizationMethod = this.xmlSignatureFactory.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, (C14NMethodParameterSpec) null);
        SignatureMethod signatureMethod = this.xmlSignatureFactory.newSignatureMethod(this.getSignatureDigestName(certificate.getSigAlgName()), null);

        this.signedInfo = this.xmlSignatureFactory.newSignedInfo(canonicalizationMethod, signatureMethod, Collections.singletonList(reference));

        KeyInfoFactory keyInfoFactory = this.xmlSignatureFactory.getKeyInfoFactory();
        KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
View Full Code Here

            } else if (secretKey != null) {
                key = KeyUtils.prepareSecretKey(sigAlgo, secretKey);
            } else {
                key = userCrypto.getPrivateKey(user, password);
            }
            SignatureMethod signatureMethod =
                signatureFactory.newSignatureMethod(sigAlgo, null);
            SignedInfo signedInfo =
                signatureFactory.newSignedInfo(c14nMethod, signatureMethod, referenceList);
           
            sig = signatureFactory.newXMLSignature(
View Full Code Here

TOP

Related Classes of javax.xml.crypto.dsig.SignatureMethod

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.