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;
17
18pub use base::NetHsm;
19pub use base::impl_openpgp::{extract_openpgp_certificate, tsk_to_private_key_import};
20// Publicly re-export chrono facilities used in the API of NetHsm.
21pub use chrono::{DateTime, Utc};
22pub use connection::{Connection, Url};
23pub use error::Error;
24pub use key::{Error as KeyError, KeyId, tls_key_type_matches_length};
25pub use nethsm_sdk::{BootMode, LogLevel, TlsKeyType, UserRole};
26// Publicly re-export nethsm_sdk_rs types that are used in return values of the NetHsm API.
27pub use nethsm_sdk_rs::models::{
28    DistinguishedName,
29    InfoData,
30    LoggingConfig,
31    NetworkConfigInput,
32    NetworkConfigOutput,
33    PublicKey,
34    SystemInfo,
35    SystemState,
36    SystemUpdateData,
37    UserData,
38};
39// Publicly re-export signstar_crypto types that are used in the NetHsm API.
40pub use signstar_crypto::{
41    Error as SignstarCryptoError,
42    key::{
43        CryptographicKeyContext,
44        DecryptMode,
45        EncryptMode,
46        KeyFormat,
47        KeyMechanism,
48        KeyType,
49        PrivateKeyImport,
50        SignatureType,
51        key_type_and_mechanisms_match_signature_type,
52        key_type_matches_length,
53        key_type_matches_mechanisms,
54    },
55    openpgp::{OpenPgpKeyUsageFlags, OpenPgpUserId, OpenPgpUserIdList, OpenPgpVersion},
56    passphrase::Passphrase,
57    signer::{
58        error::Error as SignstarCryptoSignerError,
59        openpgp::{Deserializable, SignedSecretKey, Timestamp},
60    },
61};
62pub use tls::{ConnectionSecurity, DEFAULT_MAX_IDLE_CONNECTIONS, DEFAULT_TIMEOUT_SECONDS};
63pub use user::{
64    Credentials,
65    Error as UserError,
66    FullCredentials,
67    NamespaceId,
68    NamespacedUserId,
69    SystemWideUserId,
70    UserId,
71};