Skip to main content

LocalAuthority

Trait LocalAuthority 

Source
pub trait LocalAuthority:
    Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &str;
    fn cert_chain(&self) -> &[CertificateDer<'static>];
    fn sign(&self, data: &[u8]) -> BoxFuture<'_, Result<Vec<u8>, SignError>>;

    // Provided methods
    fn public_key(&self) -> SubjectPublicKeyInfoDer<'_> { ... }
    fn verify(
        &self,
        data: &[u8],
        signature: &[u8],
    ) -> BoxFuture<'_, Result<bool, VerifyError>> { ... }
}
Expand description

Local authority for DHTTP identity material.

Signatures use DHTTP’s canonical key-to-signature-scheme policy instead of accepting a caller-supplied scheme. The policy is:

Callers should treat sign and verify as DHTTP identity operations, not as general-purpose cryptographic primitives with negotiable algorithms.

Required Methods§

Source

fn name(&self) -> &str

Source

fn cert_chain(&self) -> &[CertificateDer<'static>]

Source

fn sign(&self, data: &[u8]) -> BoxFuture<'_, Result<Vec<u8>, SignError>>

Provided Methods§

Source

fn public_key(&self) -> SubjectPublicKeyInfoDer<'_>

Source

fn verify( &self, data: &[u8], signature: &[u8], ) -> BoxFuture<'_, Result<bool, VerifyError>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§