public CCPDRequestBuilder() { super(new DVCSRequestInformationBuilder(ServiceType.CCPD)); }
public CPDRequestBuilder() { super(new DVCSRequestInformationBuilder(ServiceType.CPD)); }
public VPKCRequestBuilder() { super(new DVCSRequestInformationBuilder(ServiceType.VPKC)); }
public VSDRequestBuilder() { super(new DVCSRequestInformationBuilder(ServiceType.VSD)); }
/** * Construct a DVCS Request from a ContentInfo * * @param contentInfo the contentInfo representing the DVCSRequest * @throws DVCSConstructionException */ public DVCSRequest(ContentInfo contentInfo) throws DVCSConstructionException { super(contentInfo); if (!DVCSObjectIdentifiers.id_ct_DVCSRequestData.equals(contentInfo.getContentType())) { throw new DVCSConstructionException("ContentInfo not a DVCS Request"); } try { if (contentInfo.getContent().toASN1Primitive() instanceof ASN1Sequence) { this.asn1 = org.bouncycastle.asn1.dvcs.DVCSRequest.getInstance(contentInfo.getContent()); } else { this.asn1 = org.bouncycastle.asn1.dvcs.DVCSRequest.getInstance(ASN1OctetString.getInstance(contentInfo.getContent()).getOctets()); } } catch (Exception e) { throw new DVCSConstructionException("Unable to parse content: " + e.getMessage(), e); } this.reqInfo = new DVCSRequestInfo(asn1.getRequestInformation()); int service = reqInfo.getServiceType(); if (service == ServiceType.CPD.getValue().intValue()) { this.data = new CPDRequestData(asn1.getData()); } else if (service == ServiceType.VSD.getValue().intValue()) { this.data = new VSDRequestData(asn1.getData()); } else if (service == ServiceType.VPKC.getValue().intValue()) { this.data = new VPKCRequestData(asn1.getData()); } else if (service == ServiceType.CCPD.getValue().intValue()) { this.data = new CCPDRequestData(asn1.getData()); } else { throw new DVCSConstructionException("Unknown service type: " + service); } }