Search in sources :

Example 1 with SignatureAddingWonMessageProcessor

use of won.protocol.message.processor.impl.SignatureAddingWonMessageProcessor in project webofneeds by researchstudio-sat.

the class VerifyAndSignExamples method init.

@Before
public void init() throws Exception {
    // initialize signature adding and signature checking processors:
    Security.addProvider(new BouncyCastleProvider());
    File keysFile = new File(this.getClass().getResource(TestSigningUtils.KEYS_FILE).getFile());
    FileBasedKeyStoreService storeService = new FileBasedKeyStoreService(keysFile, "temp");
    storeService.init();
    nodeAddingProcessor = new SignatureAddingWonMessageProcessor();
    CryptographyService cryptographyService = new CryptographyService(storeService, TestSigningUtils.ownerCertUri);
    nodeAddingProcessor.setCryptographyService(cryptographyService);
    ownerAddingProcessor = new SignatureAddingWonMessageProcessor();
    ownerAddingProcessor.setCryptographyService(cryptographyService);
    checkingProcessor = new SignatureCheckingWonMessageProcessor();
    DefaultWebIdKeyLoader keyLoader = new DefaultWebIdKeyLoader();
    keyLoader.setLinkedDataSource(new TestingDataSource());
    checkingProcessor.setWebIdKeyLoader(keyLoader);
}
Also used : FileBasedKeyStoreService(won.cryptography.service.keystore.FileBasedKeyStoreService) DefaultWebIdKeyLoader(won.cryptography.rdfsign.DefaultWebIdKeyLoader) SignatureAddingWonMessageProcessor(won.protocol.message.processor.impl.SignatureAddingWonMessageProcessor) File(java.io.File) CryptographyService(won.cryptography.service.CryptographyService) SignatureCheckingWonMessageProcessor(won.protocol.message.processor.impl.SignatureCheckingWonMessageProcessor) BouncyCastleProvider(org.bouncycastle.jce.provider.BouncyCastleProvider) TestingDataSource(won.cryptography.utils.TestingDataSource) Before(org.junit.Before)

Aggregations

File (java.io.File)1 BouncyCastleProvider (org.bouncycastle.jce.provider.BouncyCastleProvider)1 Before (org.junit.Before)1 DefaultWebIdKeyLoader (won.cryptography.rdfsign.DefaultWebIdKeyLoader)1 CryptographyService (won.cryptography.service.CryptographyService)1 FileBasedKeyStoreService (won.cryptography.service.keystore.FileBasedKeyStoreService)1 TestingDataSource (won.cryptography.utils.TestingDataSource)1 SignatureAddingWonMessageProcessor (won.protocol.message.processor.impl.SignatureAddingWonMessageProcessor)1 SignatureCheckingWonMessageProcessor (won.protocol.message.processor.impl.SignatureCheckingWonMessageProcessor)1