public static ProofOfPossession getInstance(Object o) { if (o == null || o instanceof ProofOfPossession) { return (ProofOfPossession)o; } if (o instanceof ASN1TaggedObject) { return new ProofOfPossession((ASN1TaggedObject)o); } throw new IllegalArgumentException("Invalid object: " + o.getClass().getName()); }
private CertReqMsg(ASN1Sequence seq) { Enumeration en = seq.getObjects(); certReq = CertRequest.getInstance(en.nextElement()); while (en.hasMoreElements()) { Object o = en.nextElement(); if (o instanceof ASN1TaggedObject || o instanceof ProofOfPossession) { pop = ProofOfPossession.getInstance(o); } else { regInfo = ASN1Sequence.getInstance(o); } } }
/** * Return whether or not the proof-of-possession (POP) is of the type popSigningKey and * it has a public key MAC associated with it. * * @return true if POP is popSigningKey and a PKMAC is present, false otherwise. */ public boolean hasSigningKeyProofOfPossessionWithPKMAC() { ProofOfPossession pop = certReqMsg.getPopo(); if (pop.getType() == popSigningKey) { POPOSigningKey popoSign = POPOSigningKey.getInstance(pop.getObject()); return popoSign.getPoposkInput().getPublicKeyMAC() != null; } return false; }
/** * Return the type of the proof-of-possession this request message provides. * * @return one of: popRaVerified, popSigningKey, popKeyEncipherment, popKeyAgreement */ public int getProofOfPossessionType() { return this.certReqMsg.getPopo().getType(); }
/** * Return the type of the proof-of-possession this request message provides. * * @return one of: popRaVerified, popSigningKey, popKeyEncipherment, popKeyAgreement */ public int getProofOfPossessionType() { return this.certReqMsg.getPopo().getType(); }
/** * Return whether or not the proof-of-possession (POP) is of the type popSigningKey and * it has a public key MAC associated with it. * * @return true if POP is popSigningKey and a PKMAC is present, false otherwise. */ public boolean hasSigningKeyProofOfPossessionWithPKMAC() { ProofOfPossession pop = certReqMsg.getPopo(); if (pop.getType() == popSigningKey) { POPOSigningKey popoSign = POPOSigningKey.getInstance(pop.getObject()); return popoSign.getPoposkInput().getPublicKeyMAC() != null; } return false; }
public static ProofOfPossession getInstance(Object o) { if (o == null || o instanceof ProofOfPossession) { return (ProofOfPossession)o; } if (o instanceof ASN1TaggedObject) { return new ProofOfPossession((ASN1TaggedObject)o); } throw new IllegalArgumentException("Invalid object: " + o.getClass().getName()); }
private CertReqMsg(ASN1Sequence seq) { Enumeration en = seq.getObjects(); certReq = CertRequest.getInstance(en.nextElement()); while (en.hasMoreElements()) { Object o = en.nextElement(); if (o instanceof ASN1TaggedObject || o instanceof ProofOfPossession) { pop = ProofOfPossession.getInstance(o); } else { regInfo = ASN1Sequence.getInstance(o); } } }
/** * Return whether or not a signing key proof-of-possession (POP) is valid. * * @param verifierProvider a provider that can produce content verifiers for the signature contained in this POP. * @return true if the POP is valid, false otherwise. * @throws CRMFException if there is a problem in verification or content verifier creation. * @throws IllegalStateException if POP not appropriate. */ public boolean isValidSigningKeyPOP(ContentVerifierProvider verifierProvider) throws CRMFException, IllegalStateException { ProofOfPossession pop = certReqMsg.getPopo(); if (pop.getType() == popSigningKey) { POPOSigningKey popoSign = POPOSigningKey.getInstance(pop.getObject()); if (popoSign.getPoposkInput() != null && popoSign.getPoposkInput().getPublicKeyMAC() != null) { throw new IllegalStateException("verification requires password check"); } return verifySignature(verifierProvider, popoSign); } else { throw new IllegalStateException("not Signing Key type of proof of possession"); } }
v.add(new ProofOfPossession(builder.build(popSigner))); v.add(new ProofOfPossession(builder.build(popSigner))); v.add(new ProofOfPossession(ProofOfPossession.TYPE_KEY_ENCIPHERMENT, popoPrivKey)); v.add(new ProofOfPossession());
/** * Return whether or not a signing key proof-of-possession (POP) is valid. * * @param verifierProvider a provider that can produce content verifiers for the signature contained in this POP. * @return true if the POP is valid, false otherwise. * @throws CRMFException if there is a problem in verification or content verifier creation. * @throws IllegalStateException if POP not appropriate. */ public boolean isValidSigningKeyPOP(ContentVerifierProvider verifierProvider) throws CRMFException, IllegalStateException { ProofOfPossession pop = certReqMsg.getPopo(); if (pop.getType() == popSigningKey) { POPOSigningKey popoSign = POPOSigningKey.getInstance(pop.getObject()); if (popoSign.getPoposkInput() != null && popoSign.getPoposkInput().getPublicKeyMAC() != null) { throw new IllegalStateException("verification requires password check"); } return verifySignature(verifierProvider, popoSign); } else { throw new IllegalStateException("not Signing Key type of proof of possession"); } }
v.add(new ProofOfPossession(builder.build(popSigner))); v.add(new ProofOfPossession(builder.build(popSigner))); v.add(new ProofOfPossession(ProofOfPossession.TYPE_KEY_ENCIPHERMENT, popoPrivKey)); v.add(new ProofOfPossession());