private void checkConstruction( RequestedCertificate requested, int type, byte[] certOctets, Certificate cert) throws IOException { checkValues(requested, type, certOctets, cert); requested = RequestedCertificate.getInstance(requested); checkValues(requested, type, certOctets, cert); ASN1InputStream aIn = new ASN1InputStream(requested.toASN1Primitive().getEncoded()); Object obj = aIn.readObject(); requested = RequestedCertificate.getInstance(obj); checkValues(requested, type, certOctets, cert); }
private void checkValues( RequestedCertificate requested, int type, byte[] certOctets, Certificate cert) throws IOException { checkMandatoryField("certType", type, requested.getType()); if (requested.getType() == RequestedCertificate.certificate) { checkMandatoryField("certificate", cert.getEncoded(), requested.getCertificateBytes()); } else { checkMandatoryField("certificateOctets", certOctets, requested.getCertificateBytes()); } }
private void checkConstruction( RequestedCertificate requested, int type, byte[] certOctets, Certificate cert) throws IOException { checkValues(requested, type, certOctets, cert); requested = RequestedCertificate.getInstance(requested); checkValues(requested, type, certOctets, cert); ASN1InputStream aIn = new ASN1InputStream(requested.toASN1Object().getEncoded()); Object obj = aIn.readObject(); requested = RequestedCertificate.getInstance(obj); checkValues(requested, type, certOctets, cert); }