/// If this test fails, old key IDs in the SKS will no longer work!
If this test fails, old key IDs in the SKS will no longer work!
If this test fails old key IDs in the SKS will no longer work!
fn should_correctly_convert_tls_cert_hash_as_key_id() {
    // openssl-generated example X509 cert.
    let cert_der = hex_to_byte_vec(
        "308201423081f5a00302010202147dfa\
         b83de61da8c8aa957cbc6ad9645f2bbc\
         c9f8300506032b657030173115301306\
         035504030c0c4446494e495459205465\
         7374301e170d32313036303331373337\
         35305a170d3231303730333137333735\
         305a30173115301306035504030c0c44\
         46494e4954592054657374302a300506\
         032b657003210026c5e95c453549621b\
         2dc6475e0dde204caa3e4f326f4728fd\
         0458e7771ac03ca3533051301d060355\
         1d0e0416041484696f2370163c1c489c\
         095dfea6574a3fa88ad5301f0603551d\
         2304183016801484696f2370163c1c48\
         9c095dfea6574a3fa88ad5300f060355\
         1d130101ff040530030101ff30050603\
         2b65700341009b0e731565bcfaedb6c7\
         0805fa75066ff931b8bc6993c10bf020\
         2c14b96ab5abd0704f163cb0a6b57621\
         2b2eb8ddf74ab60d5cdc59f906acc8a1\
         24678c290e06",
    );
    let cert = TlsPublicKeyCert::new_from_der(cert_der)
        .expect("failed to build TlsPublicKeyCert from DER");
    let key_id = tls_cert_hash_as_key_id(&cert);
    // We expect the following hard coded key id:
    let expected_key_id =
        hex_to_32_bytes("bc1f70570a2aaa0904069e1a77b710c729ac1bf026a02f14ad8613c3627b211a");
    assert_eq!(key_id, KeyId(expected_key_id));
}
fn should_correctly_convert_tls_cert_hash_as_key_id ( ) { // openssl-generated example X509 cert. let cert_der = hex_to_byte_vec ( " \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 " , ) ; let cert = TlsPublicKeyCert :: new_from_der ( cert_der ) . expect ( " " ) ; let key_id = tls_cert_hash_as_key_id ( & cert ) ; // We expect the following hard coded key id: let expected_key_id = hex_to_32_bytes ( " " ) ; assert_eq ! ( key_id KeyId ( expected_key_id ) ) ; }
If this test fails, old key IDs in the SKS will no longer work!
If this test fails old key IDs in the SKS will no longer work!