Code example for KeyException

0
        } 
    } 
 
    public PublicKey getPublicKey() throws KeyException {
        if (publicKey == null) {
            throw new KeyException("can't convert KeyValue to PublicKey");
        } else { 
            return publicKey;
        } 
    } 
 
    public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
        throws MarshalException { 
        Document ownerDoc = DOMUtils.getOwnerDocument(parent);
 
        // create KeyValue element 
        Element kvElem = DOMUtils.createElement
            (ownerDoc, "KeyValue", XMLSignature.XMLNS, dsPrefix);
        marshalPublicKey(kvElem, ownerDoc, dsPrefix, context);
 
Contextual code suggestions in your IDE  Get Codota for Java