Skip to main content

nethsm/
lib.rs

1#![doc = include_str!("../README.md")]
2
3#[cfg(feature = "backup")]
4pub mod backup;
5mod base;
6#[cfg(feature = "cli")]
7pub mod cli;
8pub mod connection;
9mod error;
10mod key;
11mod nethsm_sdk;
12pub mod signer;
13#[cfg(feature = "_test-helpers")]
14pub mod test;
15mod tls;
16mod user;
17pub use base::NetHsm;
18pub use base::impl_openpgp::{extract_openpgp_certificate, tsk_to_private_key_import};
19pub use connection::{Connection, Url};
20pub use error::Error;
21// Publicly re-export jiff facilities used in the API of NetHsm.
22pub use jiff::Timestamp as JiffTimestamp;
23pub use key::{Error as KeyError, KeyId, tls_key_type_matches_length};
24pub use nethsm_sdk::{BootMode, LogLevel, TlsKeyType, UserRole};
25// Publicly re-export nethsm_sdk_rs types that are used in return values of the NetHsm API.
26pub use nethsm_sdk_rs::models::{
27    DistinguishedName,
28    InfoData,
29    LoggingConfig,
30    NetworkConfigInput,
31    NetworkConfigOutput,
32    PublicKey,
33    SystemInfo,
34    SystemState,
35    SystemUpdateData,
36    UserData,
37};
38// Publicly re-export signstar_crypto types that are used in the NetHsm API.
39pub use signstar_crypto::{
40    Error as SignstarCryptoError,
41    key::{
42        CryptographicKeyContext,
43        DecryptMode,
44        EncryptMode,
45        KeyFormat,
46        KeyMechanism,
47        KeyType,
48        PrivateKeyImport,
49        SignatureType,
50        key_type_and_mechanisms_match_signature_type,
51        key_type_matches_length,
52        key_type_matches_mechanisms,
53    },
54    openpgp::{OpenPgpKeyUsageFlags, OpenPgpUserId, OpenPgpUserIdList, OpenPgpVersion},
55    passphrase::Passphrase,
56    signer::{
57        error::Error as SignstarCryptoSignerError,
58        openpgp::{Deserializable, SignedSecretKey, Timestamp},
59    },
60};
61pub use tls::{ConnectionSecurity, DEFAULT_MAX_IDLE_CONNECTIONS, DEFAULT_TIMEOUT_SECONDS};
62pub use user::{
63    Credentials,
64    Error as UserError,
65    FullCredentials,
66    NamespaceId,
67    NamespacedUserId,
68    SystemWideUserId,
69    UserId,
70};