VPKCRequestData(Data data) throws DVCSConstructionException { super(data); TargetEtcChain[] certs = data.getCerts(); if (certs == null) { throw new DVCSConstructionException("DVCSRequest.data.certs should be specified for VPKC service"); } chains = new ArrayList(certs.length); for (int i = 0; i != certs.length; i++) { chains.add(new TargetChain(certs[i])); } }
/** * Builds CCPD request. * * @param messageImprint - the message imprint to include. * @return * @throws DVCSException */ public DVCSRequest build(MessageImprint messageImprint) throws DVCSException { Data data = new Data(messageImprint.toASN1Structure()); return createDVCRequest(data); }
/** * Build CPD request. * * @param messageBytes - data to be certified * @return * @throws DVCSException */ public DVCSRequest build(byte[] messageBytes) throws DVCSException, IOException { Data data = new Data(messageBytes); return createDVCRequest(data); }
/** * Build DVCS request to VPKC service. * * @throws DVCSException */ public DVCSRequest build() throws DVCSException { Data data = new Data((TargetEtcChain[])chains.toArray(new TargetEtcChain[chains.size()])); return createDVCRequest(data); }
/** * Build VSD request from CMS SignedData object. * * @param document * @return * @throws DVCSException */ public DVCSRequest build(CMSSignedData document) throws DVCSException { try { Data data = new Data(document.getEncoded()); return createDVCRequest(data); } catch (IOException e) { throw new DVCSException("Failed to encode CMS signed data", e); } }
protected DVCSRequest createDVCRequest(Data data) throws DVCSException { if (!extGenerator.isEmpty()) { requestInformationBuilder.setExtensions(extGenerator.generate()); } org.bouncycastle.asn1.dvcs.DVCSRequest request = new org.bouncycastle.asn1.dvcs.DVCSRequest(requestInformationBuilder.build(), data); return new DVCSRequest(new ContentInfo(DVCSObjectIdentifiers.id_ct_DVCSRequestData, request)); }
/** * Builds CCPD request. * * @param messageImprint - the message imprint to include. * @return a new DVCSRequest based on the state of this builder. * @throws DVCSException if an issue occurs during construction. */ public DVCSRequest build(MessageImprint messageImprint) throws DVCSException { Data data = new Data(messageImprint.toASN1Structure()); return createDVCRequest(data); }
/** * Build CPD request. * * @param messageBytes - data to be certified * @return a DVSCRequest based on the builder's current state and messageBytes. * @throws DVCSException on a build issue. */ public DVCSRequest build(byte[] messageBytes) throws DVCSException { Data data = new Data(messageBytes); return createDVCRequest(data); }
/** * Build DVCS request to VPKC service. * * @return a new DVCSRequest based on the state of this builder. * @throws DVCSException if an issue occurs during construction. */ public DVCSRequest build() throws DVCSException { Data data = new Data((TargetEtcChain[])chains.toArray(new TargetEtcChain[chains.size()])); return createDVCRequest(data); }
/** * Build VSD request from CMS SignedData object. * * @param document the CMS SignedData to include in the request. * @return a new DVCSRequest based on the state of this builder. * @throws DVCSException if an issue occurs during construction. */ public DVCSRequest build(CMSSignedData document) throws DVCSException { try { Data data = new Data(document.getEncoded()); return createDVCRequest(data); } catch (IOException e) { throw new DVCSException("Failed to encode CMS signed data", e); } }
CPDRequestData(Data data) throws DVCSConstructionException { super(data); initMessage(); }
VSDRequestData(Data data) throws DVCSConstructionException { super(data); initDocument(); }
private void validate(String name, Data result, Data expected) { validate(name + ".message", result.getMessage(), expected.getMessage()); validate(name + ".messageImprint", result.getMessageImprint(), expected.getMessageImprint()); validateArray(name + ".certs", result.getCerts(), expected.getCerts()); }