nethsm/
lib.rs

1#![doc = include_str!("../README.md")]
2
3mod base;
4pub mod connection;
5mod error;
6mod key;
7mod nethsm_sdk;
8pub mod openpgp;
9#[cfg(feature = "test-helpers")]
10pub mod test;
11mod tls;
12mod user;
13
14pub use base::NetHsm;
15// Publicly re-export chrono facilities used in the API of NetHsm.
16pub use chrono::{DateTime, Utc};
17pub use connection::{Connection, Url};
18pub use error::Error;
19pub use key::{KeyId, tls_key_type_matches_length};
20pub use nethsm_sdk::{BootMode, LogLevel, TlsKeyType, UserRole};
21// Publicly re-export nethsm_sdk_rs types that are used in return values of the NetHsm API.
22pub use nethsm_sdk_rs::models::{
23    DistinguishedName,
24    InfoData,
25    LoggingConfig,
26    NetworkConfig,
27    PublicKey,
28    SystemInfo,
29    SystemState,
30    SystemUpdateData,
31    UserData,
32};
33pub use openpgp::{extract_certificate as extract_openpgp_certificate, tsk_to_private_key_import};
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};
52pub use tls::{
53    ConnectionSecurity,
54    DEFAULT_MAX_IDLE_CONNECTIONS,
55    DEFAULT_TIMEOUT_SECONDS,
56    HostCertificateFingerprints,
57};
58pub use user::{Credentials, Error as UserError, FullCredentials, NamespaceId, UserId};