public class SignatureAlgorithmCarroll2003 extends Object implements SignatureAlgorithmInterface
| Constructor and Description |
|---|
SignatureAlgorithmCarroll2003() |
| Modifier and Type | Method and Description |
|---|---|
void |
addC14NPrefix(GraphCollection gc)
Adds c14n prefix to the graph collection (reduces output size)
|
void |
assemble(GraphCollection gc,
String signatureGraphName)
Assembles a
GraphCollection (add signature(s) and a signature graph). |
void |
canonicalize(GraphCollection gc)
Canonicalizes a
GraphCollection for a unique representation (commonly blank node removal/labeling and sorting). |
String |
getName()
Gets the name of the signature algorithm (used for identification of the algorithm when signing/verifying)
|
void |
hash(GraphCollection gc,
String digestAlgo)
Calculates the hash value of a
GraphCollection and safes it in its SignatureData. |
BigInteger |
hashTriples(BigInteger hash,
ArrayList<Triple> triples,
MessageDigest d)
Hash a vector of triples
|
void |
nondeterministicPreCanonicalization(NamedGraph g)
Performs nondeterministic pre-canonicalization
Use multiple one-step deterministic labeling passes
Steps (some may be skipped depending on blank nodes):
1) substituteBlankNodes & oneStepDeterministicLabelling
2) remove all triples with c14n:true predicate
3) substituteBlankNodes & oneStepDeterministicLabelling
4) Add new triples with c14n:true predicate for hard to label blank nodes
5) substituteBlankNodes & oneStepDeterministicLabelling
Comments "(Step A)" to "(Step F)" in code below refer to the algorithm description of Carroll
|
void |
postCanonicalize(GraphCollection gc)
Executes extra steps after the actual canonicalization of a
GraphCollection |
void |
postHash(GraphCollection gc)
Executes extra steps after the actual hash calculation of a
GraphCollection |
void |
sign(GraphCollection gc,
Key privateKey,
String verificationCertificate)
Signs
GraphCollection (calculate signature(s) using a certificate/key and the hash value(s)). |
boolean |
verify(GraphCollection gc,
Key publicKey)
Verifies a signed graph collection using a public key
Involves canonicalization and hashing of the graph collection and a cryptographic signature check
|
public void canonicalize(GraphCollection gc) throws Exception
SignatureAlgorithmInterfaceGraphCollection for a unique representation (commonly blank node removal/labeling and sorting).
Must set SignatureData.canonicalizationMethod of SignatureData.canonicalize in interface SignatureAlgorithmInterfacegc - graphCollection which is canonicalizedExceptionpublic void nondeterministicPreCanonicalization(NamedGraph g) throws Exception
g - NamedGraph which will be canonicalizedExceptionpublic void addC14NPrefix(GraphCollection gc)
gc - GraphCollection to which the C14N prefix will be addedpublic void postCanonicalize(GraphCollection gc)
SignatureAlgorithmInterfaceGraphCollectionpostCanonicalize in interface SignatureAlgorithmInterfacegc - graphCollection which is canonicalizedpublic void hash(GraphCollection gc, String digestAlgo) throws Exception
SignatureAlgorithmInterfaceGraphCollection and safes it in its SignatureData.
Must set SignatureData.graphDigestMethod and SignatureData.serializationMethod of SignatureData.hash in interface SignatureAlgorithmInterfacegc - graphCollection which is hasheddigestAlgo - string specifying a digest algorithmExceptionpublic BigInteger hashTriples(BigInteger hash, ArrayList<Triple> triples, MessageDigest d) throws Exception
hash - hash to start from as byte arraytriples - triples which will be hashedd - used digest method for hashingExceptionpublic void postHash(GraphCollection gc)
SignatureAlgorithmInterfaceGraphCollectionpostHash in interface SignatureAlgorithmInterfacegc - graphCollection which is hashedpublic void sign(GraphCollection gc, Key privateKey, String verificationCertificate) throws Exception
SignatureAlgorithmInterfaceGraphCollection (calculate signature(s) using a certificate/key and the hash value(s)).
Must set SignatureData.signatureMethod of SignatureData.sign in interface SignatureAlgorithmInterfacegc - graphCollection which is signedprivateKey - key used to calculate the signatureverificationCertificate - string specifying the certificate which should be used for verificationExceptionpublic void assemble(GraphCollection gc, String signatureGraphName) throws Exception
SignatureAlgorithmInterfaceGraphCollection (add signature(s) and a signature graph).assemble in interface SignatureAlgorithmInterfacegc - graphCollection which is assembledsignatureGraphName - string name for the signature graphExceptionpublic boolean verify(GraphCollection gc, Key publicKey) throws Exception
SignatureAlgorithmInterfaceverify in interface SignatureAlgorithmInterfacegc - graphCollection which will be verifiedpublicKey - key for the cryptographic signature checkExceptionpublic String getName()
SignatureAlgorithmInterfacegetName in interface SignatureAlgorithmInterfaceCopyright © 2018. All rights reserved.