Java 8 XMLSignatureFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 XMLSignatureFactory class.

This code example shows how to use the following methods:newDigestMethod, newReference
        // so we can use the default digest algorithm 
        String digestMethodUri = signatureConfig.getDigestMethodUri();
        XMLSignatureFactory sigFac = signatureConfig.getSignatureFactory();
        DigestMethod digestMethod;
        try { 
            digestMethod = sigFac.newDigestMethod(digestMethodUri, null);
        } catch (GeneralSecurityException e) {
            throw new XMLSignatureException("unknown digest method uri: "+digestMethodUri, e);
        } 
 
        Reference reference;
        if (digestValue == null) {
            reference = sigFac.newReference(uri, digestMethod, transforms, type, id);
        } else { 
            reference = sigFac.newReference(uri, digestMethod, transforms, type, id, digestValue);
        } 
         
        brokenJvmWorkaround(reference);
 
        return reference;
5
CodeRank
This code example shows how to use the following methods:getURIDereferencer
            uri = uri.substring(2);
        } 
        // :END 
        if (!uri.equals(documentURI)) {
 
            final URIDereferencer uriDereferencer = factory.getURIDereferencer();
            final Data data = uriDereferencer.dereference(uriReference, context);
            if (LOG.isInfoEnabled()) { 
                LOG.info("--> Reference dereferenced: " + uriReference.getURI() + "=" + (data != null) + " | Reference type: " + uriReference.getType());
            } 
            return data;
        } 
        if(document==null) {
 
            return null; 
        } 
        final InputStream octetStream = document.openStream();
        return new OctetStreamData(octetStream);
    } 
} 
3
CodeRank
See Code Examples for Java 8 XMLSignatureFactory Methods: