Skip to main content

ArtifactSigner

Trait ArtifactSigner 

Source
pub trait ArtifactSigner {
    // Required methods
    fn kid(&self) -> &str;
    fn cose_algorithm(&self) -> SigningAlgorithm;
    fn jws_algorithm(&self) -> &str;
    fn sign(&self, data: &[u8]) -> Result<Vec<u8>, CoseError>;
}
Expand description

Signs PIC artifacts (COSE payloads and the JWS envelope) with one key.

Implemented by workloads (candidate artifacts) and by the settlement authority (checkpoints and settled artifacts).

Required Methods§

Source

fn kid(&self) -> &str

Key identifier (SPIFFE ID, DID, URL, …) placed in the COSE protected header.

Source

fn cose_algorithm(&self) -> SigningAlgorithm

COSE algorithm this signer produces.

Source

fn jws_algorithm(&self) -> &str

JOSE alg value for JWS signatures (for example "EdDSA").

Source

fn sign(&self, data: &[u8]) -> Result<Vec<u8>, CoseError>

Signs raw bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§