net.handle.hdllib
Class SecureResolver.HDLSignature

java.lang.Object
  extended by net.handle.hdllib.SecureResolver.HDLSignature
Enclosing class:
SecureResolver

public class SecureResolver.HDLSignature
extends java.lang.Object


Field Summary
 boolean signatureTrusted
           
 boolean signatureVerified
           
 
Method Summary
 boolean claimsValue(HandleValue value)
          Return true if the signature claims to sign the given value.
 java.lang.String getSigner()
          Return the identifier for signing entity (unverified until verifySignature() is called).
 java.lang.String toString()
           
 boolean verifySignature(java.util.Collection<java.security.PublicKey> keys, boolean majorityRules)
          Returns true if the metadata signature has been signed by one of the given keys.
 boolean verifyValue(HandleValue value)
          Return true if the given value was properly signed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

signatureVerified

public boolean signatureVerified

signatureTrusted

public boolean signatureTrusted
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSigner

public final java.lang.String getSigner()
Return the identifier for signing entity (unverified until verifySignature() is called).


verifySignature

public final boolean verifySignature(java.util.Collection<java.security.PublicKey> keys,
                                     boolean majorityRules)
                              throws java.lang.Exception
Returns true if the metadata signature has been signed by one of the given keys. Note that this alone does not ensure that the handle values are valid - you must also call verifyValue() on each handle value to determine if the signature for that specific value is valid. This allows for the possibility of partial signatures and unsigned values in a handle.

Throws:
java.lang.Exception

verifyValue

public final boolean verifyValue(HandleValue value)
                          throws java.lang.Exception
Return true if the given value was properly signed. Note that this does not ensure that the signer is trusted. That should be done by the calling code using the getSigner()

Throws:
java.lang.Exception

claimsValue

public final boolean claimsValue(HandleValue value)
                          throws java.lang.Exception
Return true if the signature claims to sign the given value.

Throws:
java.lang.Exception