internal SingletonKeySelector(java.security.Key key) { if (key == null) { throw new java.lang.NullPointerException(); } this.key = key; }
/* * Creates a <code>DOMValidateContext</code> containing the specified key * and node. The validating key will be stored in a * {@link KeySelector#singletonKeySelector singleton KeySelector} that * is returned when the {@link #getKeySelector getKeySelector} * method is called. * * @param validatingKey the validating key * @param node the node * @throws NullPointerException if <code>validatingKey</code> or * <code>node</code> is <code>null</code> */ public DOMValidateContext(java.security.Key validatingKey, org.w3c.dom.Node node) { if (validatingKey == null) { throw new java.lang.NullPointerException("validatingKey is null"); } if (node == null) { throw new java.lang.NullPointerException("node is null"); } setKeySelector(KeySelector.singletonKeySelector(validatingKey)); this.node = node; }
/** * Creates a <code>DOMSignContext</code> with the specified signing key * and parent node. The signing key is stored in a * {@link KeySelector#singletonKeySelector singleton KeySelector} that is * returned by the {@link #getKeySelector getKeySelector} method. * The marshalled <code>XMLSignature</code> will be added as the last * child element of the specified parent node unless a next sibling node is * specified by invoking the {@link #setNextSibling setNextSibling} method. * * @param signingKey the signing key * @param parent the parent node * @throws NullPointerException if <code>signingKey</code> or * <code>parent</code> is <code>null</code> */ public DOMSignContext(java.security.Key signingKey, org.w3c.dom.Node parent) { if (signingKey == null) { throw new java.lang.NullPointerException("signingKey cannot be null"); } if (parent == null) { throw new java.lang.NullPointerException("parent cannot be null"); } setKeySelector(KeySelector.singletonKeySelector(signingKey)); this.parent = parent; }
;// throws KeySelectorException; /** * Returns a <code>KeySelector</code> that always selects the specified * key, regardless of the <code>KeyInfo</code> passed to it. * * @param key the sole key to be stored in the key selector * @return a key selector that always selects the specified key * @throws NullPointerException if <code>key</code> is <code>null</code> */ public static KeySelector singletonKeySelector(java.security.Key key) { return(new SingletonKeySelector(key)); }