我遇到了下一个问题:我不知道在哪里可以获取用于调用正确 NTRUSigningPrivateKeyParameters 的私钥字节数组。
这是我的代码:
byte [] b = new byte[16];
Security.addProvider(new BouncyCastleProvider());
NTRUSigningKeyGenerationParameters ntruSigningKeyGenerationParameters = NTRUSigningKeyGenerationParameters.TEST157;
NTRUSigningPrivateKeyParameters ntruSigningPrivateKeyParameters = null;
NTRUSigner ntruSigner = new NTRUSigner(ntruSigningKeyGenerationParameters.getSigningParameters());
try {
ntruSigningPrivateKeyParameters = new NTRUSigningPrivateKeyParameters(b, ntruSigningKeyGenerationParameters); // here I need to get byte array from private key
} catch (IOException e) {
e.printStackTrace();
}
ntruSigner.init(true, ntruSigningPrivateKeyParameters);
byte [] res = ntruSigner.generateSignature();
有没有人有同样的问题?