public static boolean verifyEpochPK ( PublicKey pk , Idemix . ECP2 epochPK , byte [ ] epochPkSig , long epoch , RevocationAlgorithm alg ) throws CryptoException { Idemix . CredentialRevocationInformation . Builder builder = Idemix . CredentialRevocationInformation . newBuilder ( ) ; builder . setRevocationAlg ( alg . ordinal ( ) ) ; builder . setEpochPk ( epochPK ) ; builder . setEpoch ( epoch ) ; Idemix . CredentialRevocationInformation cri = builder . build ( ) ; byte [ ] bytesTosign = cri . toByteArray ( ) ; try { Signature dsa = Signature . getInstance ( "SHA256withECDSA" ) ; dsa . initVerify ( pk ) ; dsa . update ( bytesTosign ) ; return dsa . verify ( epochPkSig ) ; } catch ( NoSuchAlgorithmException | SignatureException | InvalidKeyException e ) { throw new CryptoException ( "Error during the EpochPK verification" , e ) ; } }
Verifies that the revocation PK for a certain epoch is valid by checking that it was signed with the long term revocation key