org.rdfcontext.signing
Class SignatureReport

java.lang.Object
  extended byorg.rdfcontext.signing.SignatureReport

public class SignatureReport
extends java.lang.Object

An immutable object representing a piece of signed data. It contains the signature's information. It also can check for validity of the signature and for integrity of signed data. NOTE: SignatureReports can be extracted from an RDF Graph using the RDFSigner utility.

See Also:
RDFSigner

Constructor Summary
SignatureReport(LiveDBinSignature live, java.lang.String data, IURLResolver urlResolver)
          Deprecated. This constructor might not been used. The right way to sign data is via RDFSigner.signModel() method.
SignatureReport(java.lang.String data, java.lang.String signatureValue, java.net.URL publicKey, java.lang.String kindOfCertificate, IURLResolver urlresolver)
          Build a new signature report from the given data, signature value, certificate URI and the kind of certificate This constructor is used by the RDFSigner object.
 
Method Summary
 java.security.PublicKey extractPublicKey()
           
 java.security.PublicKey extractPublicKey(java.net.URL certificateURL)
          Extract the public key from a PGP or X.509 certificate given it's valid URL
 java.lang.String getDataSigned()
           
 java.lang.String getKindOfCertificate()
           
 java.net.URL getPublicKeyCertificateURL()
           
 java.lang.String getPublicKeyCertificateURLString()
           
 java.lang.String getSignatureValue()
           
 boolean isValid()
          Tests the validity of the stored certificate.
 boolean testSignature(java.security.PublicKey pubKey)
          Checks if the RDFGraph has been segned using the given PublicKey
 boolean testSignature(java.net.URL certificateURL)
          Checks if the RDFGraph has been segned using the PublicKey retrived from the specified certificate's URL.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SignatureReport

public SignatureReport(java.lang.String data,
                       java.lang.String signatureValue,
                       java.net.URL publicKey,
                       java.lang.String kindOfCertificate,
                       IURLResolver urlresolver)
Build a new signature report from the given data, signature value, certificate URI and the kind of certificate This constructor is used by the RDFSigner object. NOTE: This constructor is for internal use only! RDFSigner (used to generate the results of ListSignatureReports()).

Parameters:
data - - data signed
signatureValue - - the signature string 64-encoded
publicKey - - the URI where the public key is stored
kindOfCertificate - - the kind of certificate(PGP or X.509)

SignatureReport

public SignatureReport(LiveDBinSignature live,
                       java.lang.String data,
                       IURLResolver urlResolver)
                throws java.io.IOException,
                       org.bouncycastle.openpgp.PGPException,
                       java.security.InvalidKeyException,
                       java.security.NoSuchAlgorithmException,
                       java.security.NoSuchProviderException,
                       java.security.SignatureException
Deprecated. This constructor might not been used. The right way to sign data is via RDFSigner.signModel() method.

Builds a new signature report from a LiveDbinSignature with the given data string

Parameters:
live - - a object which can sign given data
data - - a string data
Method Detail

toString

public java.lang.String toString()

getPublicKeyCertificateURLString

public java.lang.String getPublicKeyCertificateURLString()
Returns:
the URI string where the public key is stored

getKindOfCertificate

public java.lang.String getKindOfCertificate()
Returns:
the kind of certification used

getPublicKeyCertificateURL

public java.net.URL getPublicKeyCertificateURL()
Returns:
the URI where the public key is stored

getDataSigned

public java.lang.String getDataSigned()
Returns:
the data string signed

getSignatureValue

public java.lang.String getSignatureValue()
Returns:
the signature base 64 encoded

testSignature

public boolean testSignature(java.net.URL certificateURL)
Checks if the RDFGraph has been segned using the PublicKey retrived from the specified certificate's URL.

Parameters:
certificateURL - The url of the certificate , it will be retrieved with

testSignature

public boolean testSignature(java.security.PublicKey pubKey)
Checks if the RDFGraph has been segned using the given PublicKey

Parameters:
pubKey -
Returns:
true if test succeded

isValid

public boolean isValid()
Tests the validity of the stored certificate.

Returns:
true if the signature is valid, false otherwise.

extractPublicKey

public java.security.PublicKey extractPublicKey(java.net.URL certificateURL)
                                         throws PublicKeyExtractionException
Extract the public key from a PGP or X.509 certificate given it's valid URL

Parameters:
certificateURL - the URL from which the certificate can be retrived
Returns:
the public key extracted
Throws:
PublicKeyExtractionException
java.lang.Exception

extractPublicKey

public java.security.PublicKey extractPublicKey()
                                         throws PublicKeyExtractionException
Throws:
PublicKeyExtractionException