Search in sources :

Example 1 with WonSigner

use of won.cryptography.rdfsign.WonSigner in project webofneeds by researchstudio-sat.

the class WonMessageSignerVerifier method sign.

public static WonMessage sign(PrivateKey privateKey, PublicKey publicKey, String privateKeyUri, WonMessage message) throws Exception {
    Dataset msgDataset = message.getCompleteDataset();
    SigningStage sigStage = new SigningStage(message);
    addUnreferencedSigReferences(msgDataset, sigStage);
    WonSigner signer = new WonSigner(msgDataset);
    signContents(msgDataset, sigStage, signer, privateKey, privateKeyUri, publicKey);
    signEnvelopes(msgDataset, sigStage, signer, privateKey, privateKeyUri, publicKey);
    return new WonMessage(msgDataset);
}
Also used : SigningStage(won.cryptography.rdfsign.SigningStage) Dataset(org.apache.jena.query.Dataset) WonMessage(won.protocol.message.WonMessage) WonSigner(won.cryptography.rdfsign.WonSigner)

Aggregations

Dataset (org.apache.jena.query.Dataset)1 SigningStage (won.cryptography.rdfsign.SigningStage)1 WonSigner (won.cryptography.rdfsign.WonSigner)1 WonMessage (won.protocol.message.WonMessage)1