public void testNotExistingSignerIdGivesNull() throws SignatureException { assertNull("Expected Null for a non-existing Signer Id", newCertPathStore().getSignerInfo(new byte[1])); }
@Override protected void setUp() throws Exception { path = FileUtils.createTemporaryDirectory(); super.setUp(); }
@Override protected void tearDown() throws Exception { super.tearDown(); org.apache.commons.io.FileUtils.deleteDirectory(path); } }
public void testCertificatesAreStored() throws Exception { CertPathStore certPathStore = newCertPathStore(); ProtocolSignerInfo realSignerInfoProto = realSignerInfo.toProtoBuf(); certPathStore.putSignerInfo(realSignerInfoProto); ProtocolSignerInfo exampleSignerInfoProto = exampleSignerInfo.toProtoBuf(); certPathStore.putSignerInfo(exampleSignerInfoProto); checkCertificateExists(realSignerInfo, certPathStore); checkCertificateExists(exampleSignerInfo, certPathStore); }
/** * Checks whether for the given {@link SignerInfo} the certificates retrieved * from the {@link CertPathStore} match up. * * @param signerInfo the {@link SignerInfo} to get the certificates from the * {@link CertPathStore} for * @param certPathStore the {@link CertPathStore} to retrieve the certificates * from. */ private void checkCertificateExists(SignerInfo signerInfo, CertPathStore certPathStore) throws SignatureException { List<X509Certificate> retrievedCerts = certPathStore.getSignerInfo(signerInfo.getSignerId()).getCertificates(); assertEquals(signerInfo.getCertificates(), retrievedCerts); } }
public void testCertificatesAreStored() throws Exception { CertPathStore certPathStore = newCertPathStore(); ProtocolSignerInfo realSignerInfoProto = realSignerInfo.toProtoBuf(); certPathStore.putSignerInfo(realSignerInfoProto); ProtocolSignerInfo exampleSignerInfoProto = exampleSignerInfo.toProtoBuf(); certPathStore.putSignerInfo(exampleSignerInfoProto); checkCertificateExists(realSignerInfo, certPathStore); checkCertificateExists(exampleSignerInfo, certPathStore); }
/** * Checks whether for the given {@link SignerInfo} the certificates retrieved * from the {@link CertPathStore} match up. * * @param signerInfo the {@link SignerInfo} to get the certificates from the * {@link CertPathStore} for * @param certPathStore the {@link CertPathStore} to retrieve the certificates * from. */ private void checkCertificateExists(SignerInfo signerInfo, CertPathStore certPathStore) throws SignatureException { List<X509Certificate> retrievedCerts = certPathStore.getSignerInfo(signerInfo.getSignerId()).getCertificates(); assertEquals(signerInfo.getCertificates(), retrievedCerts); } }
public void testNotExistingSignerIdGivesNull() throws SignatureException { assertNull("Expected Null for a non-existing Signer Id", newCertPathStore().getSignerInfo(new byte[1])); }
@Override protected void tearDown() throws Exception { super.tearDown(); org.apache.commons.io.FileUtils.deleteDirectory(path); } }
@Override protected void setUp() throws Exception { path = FileUtils.createTemporaryDirectory(); super.setUp(); }
@Override protected void tearDown() throws Exception { super.tearDown(); database.dropDatabase(); } }
@Override protected void tearDown() throws Exception { super.tearDown(); database.drop(); } }