1 4 7 package javax.xml.crypto.dsig.dom; 8 9 import javax.xml.crypto.KeySelector; 10 import javax.xml.crypto.dom.DOMCryptoContext; 11 import javax.xml.crypto.dsig.XMLSignature; 12 import javax.xml.crypto.dsig.XMLSignatureFactory; 13 import javax.xml.crypto.dsig.XMLValidateContext; 14 import java.security.Key ; 15 import org.w3c.dom.Node ; 16 17 38 public class DOMValidateContext extends DOMCryptoContext 39 implements XMLValidateContext { 40 41 private Node node; 42 43 52 public DOMValidateContext(KeySelector ks, Node node) { 53 if (ks == null) { 54 throw new NullPointerException ("key selector is null"); 55 } 56 if (node == null) { 57 throw new NullPointerException ("node is null"); 58 } 59 setKeySelector(ks); 60 this.node = node; 61 } 62 63 75 public DOMValidateContext(Key validatingKey, Node node) { 76 if (validatingKey == null) { 77 throw new NullPointerException ("validatingKey is null"); 78 } 79 if (node == null) { 80 throw new NullPointerException ("node is null"); 81 } 82 setKeySelector(KeySelector.singletonKeySelector(validatingKey)); 83 this.node = node; 84 } 85 86 93 public void setNode(Node node) { 94 if (node == null) { 95 throw new NullPointerException (); 96 } 97 this.node = node; 98 } 99 100 106 public Node getNode() { 107 return node; 108 } 109 } 110 | Popular Tags |