diff options
author | Rajesh Nyamagoud <nyamagoud@google.com> | 2023-06-08 20:31:38 +0000 |
---|---|---|
committer | Rajesh Nyamagoud <nyamagoud@google.com> | 2023-11-14 23:25:30 +0000 |
commit | e5557ffdce76d1ccdc102d88cbea027a39cbb3bb (patch) | |
tree | d417cac46110c47dc5a137c0a6911c797503371d /keystore2/test_utils | |
parent | b1c8e833920e45042f7ce1c167757b6e3f9e86c1 (diff) | |
download | security-e5557ffdce76d1ccdc102d88cbea027a39cbb3bb.tar.gz |
Test added to generate a key with specifying cerificate subject and
certificate serial number. Test generates a key and verifies the
specified key characteristics.
Bug: 279721870
Test: atest keystore2_client_tests
Change-Id: I3ea356da8ca3404a94081a680210a9f426a2b908
Diffstat (limited to 'keystore2/test_utils')
-rw-r--r-- | keystore2/test_utils/authorizations.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/keystore2/test_utils/authorizations.rs b/keystore2/test_utils/authorizations.rs index 61260c78..2cb2aaf6 100644 --- a/keystore2/test_utils/authorizations.rs +++ b/keystore2/test_utils/authorizations.rs @@ -344,6 +344,22 @@ impl AuthSetBuilder { }); self } + + /// Add certificate serial number. + pub fn cert_serial(mut self, b: Vec<u8>) -> Self { + self.0 + .push(KeyParameter { tag: Tag::CERTIFICATE_SERIAL, value: KeyParameterValue::Blob(b) }); + self + } + + /// Add certificate subject name. + pub fn cert_subject_name(mut self, b: Vec<u8>) -> Self { + self.0.push(KeyParameter { + tag: Tag::CERTIFICATE_SUBJECT, + value: KeyParameterValue::Blob(b), + }); + self + } } impl Deref for AuthSetBuilder { |