本文整理汇总了Java中org.keyczar.Verifier类的典型用法代码示例。如果您正苦于以下问题:Java Verifier类的具体用法?Java Verifier怎么用?Java Verifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Verifier类属于org.keyczar包,在下文中一共展示了Verifier类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verify
import org.keyczar.Verifier; //导入依赖的package包/类
public static void verify(String keyPath, String message, String signaturePath) throws KeyczarException {
// Read the key, possibly decrypting using a password
KeyczarReader reader = Util.readJsonFromPath(keyPath);
Verifier key = new Verifier(reader);
String signature = Util.readFile(signaturePath);
System.out.println("verifying signature on message length " + message.length());
if (!key.verify(message, signature)) {
System.err.println("Signature could not be verified!\n");
System.exit(1);
}
}
示例2: KeyczarPublicKey
import org.keyczar.Verifier; //导入依赖的package包/类
public KeyczarPublicKey(KeyczarReader encryptionReader, KeyczarReader signingReader)
throws KeyczarException {
super(encryptionReader, signingReader);
encrypter = new Encrypter(encryptionReader);
verifier = new Verifier(signingReader);
}
示例3: verify
import org.keyczar.Verifier; //导入依赖的package包/类
private static boolean verify(String initialText, String signature) throws KeyczarException {
Verifier verifier = new Verifier(KEYSET_PATH);
return verifier.verify(initialText, signature);
}