Generate public key as a string in DER format for tests.
| 116 | |
| 117 | // Generate public key as a string in DER format for tests. |
| 118 | Status GeneratePublicKeyStrDer(string* ret) { |
| 119 | PrivateKey private_key; |
| 120 | RETURN_NOT_OK(GeneratePrivateKey(kNumBits, &private_key)); |
| 121 | PublicKey public_key; |
| 122 | RETURN_NOT_OK(private_key.GetPublicKey(&public_key)); |
| 123 | string public_key_str_der; |
| 124 | RETURN_NOT_OK(public_key.ToString(&public_key_str_der, DataFormat::DER)); |
| 125 | *ret = public_key_str_der; |
| 126 | return Status::OK(); |
| 127 | } |
| 128 | |
| 129 | // Generate token signing key with the specified parameters. |
| 130 | Status GenerateTokenSigningKey(int64_t seq_num, |
no test coverage detected