Skip to main content

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::{Error as KeyError, 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    NetworkConfigInput,
28    NetworkConfigOutput,
29    PublicKey,
30    SystemInfo,
31    SystemState,
32    SystemUpdateData,
33    UserData,
34};
35// Publicly re-export signstar_crypto types that are used in the NetHsm API.
36pub use signstar_crypto::{
37    Error as SignstarCryptoError,
38    key::{
39        CryptographicKeyContext,
40        DecryptMode,
41        EncryptMode,
42        KeyFormat,
43        KeyMechanism,
44        KeyType,
45        PrivateKeyImport,
46        SignatureType,
47        key_type_and_mechanisms_match_signature_type,
48        key_type_matches_length,
49        key_type_matches_mechanisms,
50    },
51    openpgp::{OpenPgpKeyUsageFlags, OpenPgpUserId, OpenPgpUserIdList, OpenPgpVersion},
52    passphrase::Passphrase,
53    signer::{
54        error::Error as SignstarCryptoSignerError,
55        openpgp::{Deserializable, SignedSecretKey, Timestamp},
56    },
57};
58pub use tls::{ConnectionSecurity, DEFAULT_MAX_IDLE_CONNECTIONS, DEFAULT_TIMEOUT_SECONDS};
59pub use user::{
60    Credentials,
61    Error as UserError,
62    FullCredentials,
63    NamespaceId,
64    SystemWideUserId,
65    UserId,
66};