jsdsi
Class Proof

java.lang.Object
  extended byjsdsi.Obj
      extended byjsdsi.Proof
All Implemented Interfaces:
java.io.Serializable

public class Proof
extends Obj

A statement (a Cert) and a sequence of Certificates (Certs + validators) that proves that the statement holds. Proofs are self-validating and can be composed to create new proofs.

Version:
$Revision: 1.6.2.1 $ $Date: 2005/11/08 03:12:52 $
Author:
Sameer Ajmani, Sean Radford
See Also:
Certificate, Cert, Serialized Form

Nested Class Summary
static class Proof.IncompatibleException
          New Exception used by methods in this class.
 
Field Summary
 
Fields inherited from class jsdsi.Obj
_obj
 
Constructor Summary
Proof(Certificate c)
          Creates a new proof from a given Certificate.
 
Method Summary
 Proof compose(Proof p)
          Composes this proof with another proof.
 boolean equals(java.lang.Object o)
           
 Cert getCert()
           
 Certificate[] getCertificates()
           
 Sequence getSequence()
           
 int hashCode()
           
 SexpList toSexp()
          Creates an SexpList -representation from this SDSI-object.
 void verify()
          Verifies this proof.
 
Methods inherited from class jsdsi.Obj
parseObj, parseObj, readResolve, toByteArray, toString, toString, toTransport
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Proof

public Proof(Certificate c)
Creates a new proof from a given Certificate.

Parameters:
c - Certificate to create the Proof from.
Method Detail

getCert

public Cert getCert()
Returns:
the Cert of this Proof.

getCertificates

public Certificate[] getCertificates()
Returns:
an array of Certificates of this Proof.

getSequence

public Sequence getSequence()
Returns:
a Sequence of this certs' elements.

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in class Obj
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Specified by:
hashCode in class Obj
See Also:
Object.hashCode()

toSexp

public SexpList toSexp()
Description copied from class: Obj
Creates an SexpList -representation from this SDSI-object.

Specified by:
toSexp in class Obj
Returns:
an SexpList that represents this SDSI-object.

verify

public void verify()
            throws java.security.cert.CertificateException,
                   java.security.NoSuchAlgorithmException,
                   java.security.InvalidKeyException,
                   java.security.NoSuchProviderException,
                   java.security.SignatureException
Verifies this proof.

Throws:
java.security.cert.CertificateException - if there are no certificates in this Proof or they don't match/compose correctly.
java.security.NoSuchAlgorithmException - if an unknown crypto algorithm has been used.
java.security.InvalidKeyException - if a key in the certificate is not correct.
java.security.NoSuchProviderException - if there is no security provider for this algorithm.
java.security.SignatureException - if an error occured with a signature.
See Also:
Certificate.verify(java.security.PublicKey)

compose

public Proof compose(Proof p)
              throws Proof.IncompatibleException
Composes this proof with another proof.

Parameters:
p - the proof to compose this with.
Returns:
a new proof that is the composition of this with p.
Throws:
Proof.IncompatibleException - if this cannot be composed with p.


Copyright © 2002-2006 JSDSI. All Rights Reserved.