Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Oct 3, 2024
1 parent 1a945c0 commit d943269
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ic-agent/src/identity/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use ic_transport_types::Delegation;
use thiserror::Error;

/// An error happened while reading a PEM file.
#[cfg(feature = "pem")]
#[derive(Error, Debug)]
pub enum PemError {
/// An error occurred with disk I/O.
Expand Down Expand Up @@ -32,10 +33,12 @@ pub enum DelegationError {
/// Parsing error in delegation bytes.
#[error("A delegation could not be parsed")]
Parse,
/// A key in the chain did not match the signature of the next chain link. If `to` is `None` then it refers to the `Identity`.
/// A key in the chain did not match the signature of the next chain link.
#[error("A link was missing in the delegation chain")]
BrokenChain {
/// The key that should have matched the next delegation
from: Vec<u8>,
/// The delegation that didn't match, or `None` if the `Identity` didn't match
to: Option<Delegation>,
},
/// A key with an unknown algorithm was used. The IC supports Ed25519, secp256k1, and prime256v1, and in ECDSA the curve must be specified.
Expand Down
7 changes: 4 additions & 3 deletions ic-agent/src/identity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ use crate::{agent::EnvelopeContent, export::Principal};
pub(crate) mod anonymous;
pub(crate) mod basic;
pub(crate) mod delegated;
pub(crate) mod error;
pub(crate) mod prime256v1;
pub(crate) mod secp256k1;

#[cfg(feature = "pem")]
pub(crate) mod error;

#[doc(inline)]
pub use anonymous::AnonymousIdentity;
#[doc(inline)]
pub use basic::BasicIdentity;
#[doc(inline)]
pub use delegated::DelegatedIdentity;
#[doc(inline)]
pub use error::DelegationError;
#[doc(inline)]
pub use ic_transport_types::{Delegation, SignedDelegation};
#[doc(inline)]
pub use prime256v1::Prime256v1Identity;
#[doc(inline)]
pub use secp256k1::Secp256k1Identity;

#[cfg(feature = "pem")]
#[doc(inline)]
pub use error::PemError;

/// A cryptographic signature, signed by an [Identity].
Expand Down

0 comments on commit d943269

Please sign in to comment.