nethsm/
lib.rs

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