[작업로그] 서명 생성/검증

APRIL 13, 2020

#1. 서명 생성

  • [param]
  • algo: 
  • privKey:  the private key of the identity whose signature is going to be generated.
  • [code]

    Signature signer = Signature.getInstance(algo, "BC");
    signer.initSign(this.privKey);
    signer.update(plainText);
    return signer.sign();

#2. 서명 검증

  • [param] 
  • algo : the name of the algorithm requested.
  • pubKey: the public key of the identity whose signature is going to be verified.
  • plainText
  • signed: the signature bytes to be verified.
  • [code]

    Signature signer = Signature.getInstance(algo, "BC");
    signer.initVerify(pubKey);
    signer.update(plainText);
    return signer.verify(signed);

작업 기록 블로그