@Override public void putSignerInfo(ProtocolSignerInfo protobuff) throws SignatureException { certPathStore.putSignerInfo(protobuff); }
@Override public synchronized void storeSignerInfo(ProtocolSignerInfo signerInfo) throws SignatureException { verifier.verifySignerInfo(new SignerInfo(signerInfo)); certPathStore.putSignerInfo(signerInfo); }
@Override public void putSignerInfo(ProtocolSignerInfo protoSignerInfo) throws SignatureException { synchronized(certPathStore) { SignerInfo signerInfo = new SignerInfo(protoSignerInfo); File signerFile = new File(signerIdToFileName(signerInfo.getSignerId())); FileOutputStream file = null; try { file = new FileOutputStream(signerFile); file.write(protoSignerInfo.toByteArray()); file.flush(); certPathStore.putSignerInfo(protoSignerInfo); } catch (IOException e) { throw new SignatureException("Failed to write signer info to file: " + signerFile.getAbsolutePath(), e); } finally { FileUtils.closeAndIgnoreException(file, signerFile, LOG); } } } }
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); }
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); }