Struct AlgorithmIdentifier

struct AlgorithmIdentifier(_)

A DER encoding of the PKIX AlgorithmIdentifier type:

AlgorithmIdentifier  ::=  SEQUENCE  {
    algorithm               OBJECT IDENTIFIER,
    parameters              ANY DEFINED BY algorithm OPTIONAL  }
                               -- contains a value of the type
                               -- registered for use with the
                               -- algorithm object identifier value

(from https://www.rfc-editor.org/rfc/rfc5280#section-4.1.1.2)

The outer sequence encoding is not included, so this is the DER encoding of an OID for algorithm plus the parameters value.

For example, this is the rsaEncryption algorithm (but prefer to use the constant RSA_ENCRYPTION instead):

let rsa_encryption = rustls_pki_types::AlgorithmIdentifier::from_slice(
    &[
        // algorithm: 1.2.840.113549.1.1.1
        0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
        // parameters: NULL
        0x05, 0x00
    ]
);
assert_eq!(rustls_pki_types::alg_id::RSA_ENCRYPTION, rsa_encryption);

Common values for this type are provided in this module.

Implementations

impl AlgorithmIdentifier

const fn from_slice(bytes: &'static [u8]) -> Self

Makes a new AlgorithmIdentifier from a static octet slice.

This does not validate the contents of the slice.

impl AsRef for AlgorithmIdentifier

fn as_ref(self: &Self) -> &[u8]

impl Clone for AlgorithmIdentifier

fn clone(self: &Self) -> AlgorithmIdentifier

impl Copy for AlgorithmIdentifier

impl Debug for AlgorithmIdentifier

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Deref for AlgorithmIdentifier

fn deref(self: &Self) -> &<Self as >::Target

impl Eq for AlgorithmIdentifier

impl Freeze for AlgorithmIdentifier

impl PartialEq for AlgorithmIdentifier

fn eq(self: &Self, other: &AlgorithmIdentifier) -> bool

impl RefUnwindSafe for AlgorithmIdentifier

impl Send for AlgorithmIdentifier

impl StructuralPartialEq for AlgorithmIdentifier

impl Sync for AlgorithmIdentifier

impl Unpin for AlgorithmIdentifier

impl UnwindSafe for AlgorithmIdentifier

impl<P, T> Receiver for AlgorithmIdentifier

impl<T> Any for AlgorithmIdentifier

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for AlgorithmIdentifier

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for AlgorithmIdentifier

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for AlgorithmIdentifier

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for AlgorithmIdentifier

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for AlgorithmIdentifier

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for AlgorithmIdentifier

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for AlgorithmIdentifier

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for AlgorithmIdentifier

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>