Crate oid_registry
source ·Expand description
§OID Registry
This crate is a helper crate, containing a database of OID objects. These objects are intended for use when manipulating ASN.1 grammars and BER/DER encodings, for example.
This crate provides only a simple registry (similar to a HashMap
) by default. This object can
be used to get names and descriptions from OID.
This crate provides default lists of known OIDs, that can be selected using the build features. By default, the registry has no feature enabled, to avoid embedding a huge database in crates.
It also declares constants for most of these OIDs.
use oid_registry::OidRegistry;
let mut registry = OidRegistry::default()
.with_crypto() // only if the 'crypto' feature is enabled
;
let e = registry.get(&oid_registry::OID_PKCS1_SHA256WITHRSA);
if let Some(entry) = e {
// get sn: sha256WithRSAEncryption
println!("sn: {}", entry.sn());
// get description: SHA256 with RSA encryption
println!("description: {}", entry.description());
}
§Extending the registry
These provided lists are often incomplete, or may lack some specific OIDs. This is why the registry allows adding new entries after construction:
use asn1_rs::oid;
use oid_registry::{OidEntry, OidRegistry};
let mut registry = OidRegistry::default();
// entries can be added by creating an OidEntry object:
let entry = OidEntry::new("shortName", "description");
registry.insert(oid!(1.2.3.4), entry);
// when using static strings, a tuple can also be used directly for the entry:
registry.insert(oid!(1.2.3.5), ("shortName", "A description"));
§Versions and compatibility with asn1-rs
Versions of oid-registry
must be chosen specifically, to depend on a precise version of asn1-rs
.
The following table summarizes the matching versions:
oid-registry
0.7.x depends onasn1-rs
0.6.0oid-registry
0.6.x depends onasn1-rs
0.5.0oid-registry
0.5.x depends onasn1-rs
0.4.0
§Contributing OIDs
All OID values, constants, and features are derived from files in the assets
directory in the
build script (see build.rs
).
See load_file
for documentation of the file format.
Re-exports§
pub use asn1_rs;
Structs§
- Temporary structure, created when reading a file containing OID declarations
- Object ID (OID) representation which can be relative or non-relative. An example for an OID in string representation is
"1.2.840.113549.1.1.5"
. - An entry stored in the OID registry
- Registry of known OIDs
Constants§
- 1.3.6.1.4.1.311.10.1
- 1.3.6.1.4.1.311.60.2.1.3
- 1.3.6.1.4.1.311.60.2.1.1
- 1.3.6.1.4.1.311.60.2.1.2
- 1.3.6.1.4.1.11129.2.4.2
- 0.9.2342.19200300.100.1.25
- 1.2.840.10045.3.1.7
- 1.2.643.2.2.19
- 1.3.14.3.2.26
- 1.3.133.16.840.63.0.2
- 1.2.840.10040.4.1
- 1.2.840.10045.2.1
- 1.2.643.7.1.1.1.1
- 1.2.643.7.1.1.1.2
- 1.3.14.3.2.25
- 1.3.132.0.34
- 1.3.132.0.35
- 2.16.840.1.101.3.4.1.42
- 2.16.840.1.101.3.4.2.1
- 2.16.840.1.101.3.4.2.2
- 2.16.840.1.101.3.4.2.3
- 1.2.840.113549.1.1.2
- 1.2.840.113549.1.1.3
- 1.2.840.113549.1.1.4
- 1.2.840.113549.1.1.1
- 1.2.840.113549.1.1.10
- 1.2.840.113549.1.1.5
- 1.2.840.113549.1.1.14
- 1.2.840.113549.1.1.11
- 1.2.840.113549.1.1.12
- 1.2.840.113549.1.1.13
- 1.2.840.113549.1.7.1
- 1.2.840.113549.1.7.5
- 1.2.840.113549.1.7.6
- 1.2.840.113549.1.7.3
- 1.2.840.113549.1.7.2
- 1.2.840.113549.1.7.4
- 1.2.840.113549.1.9.7
- 1.2.840.113549.1.9.3
- 1.2.840.113549.1.9.1
- 1.2.840.113549.1.9.14
- 1.2.840.113549.1.9.20
- 1.2.840.113549.1.9.4
- 1.2.840.113549.1.9.5
- 1.2.840.113549.1.9.15
- 1.2.840.113549.1.9.2
- 1.2.840.113549.1.12
- 1.2.840.113549.1.12.1
- 1.2.840.113549.1.12.1.4
- 1.2.840.113549.1.12.1.3
- 1.2.840.113549.1.12.1.2
- 1.2.840.113549.1.12.1.6
- 1.2.840.113549.1.12.1.1
- 1.2.840.113549.1.12.1.5
- 1.3.6.1.5.5.7.48.2
- 1.3.6.1.5.5.7.48.5
- 1.3.6.1.5.5.7.48.12
- 1.3.6.1.5.5.7.48.4
- 1.3.6.1.5.5.7.48.6
- 1.3.6.1.5.5.7.48.7
- 1.3.6.1.5.5.7.48.1
- 1.3.6.1.5.5.7.48.10
- 1.3.6.1.5.5.7.48.13
- 1.3.6.1.5.5.7.48.11
- 1.3.6.1.5.5.7.48.14
- 1.3.6.1.5.5.7.48.3
- 1.3.6.1.5.5.7.1.1
- 1.3.14.3.2.29
- 1.2.840.10040.4.3
- 1.2.840.10045.4.3.1
- 1.2.840.10045.4.3.2
- 1.2.840.10045.4.3.3
- 1.2.840.10045.4.3.4
- 1.3.101.113
- 1.3.101.112
- 1.2.643.7.1.1.3.2
- 1.2.643.7.1.1.3.3
- 1.2.643.2.2.3
- 1.3.36.3.3.1.2
- 0.9.2342.19200300.100.1.1
- 2.5
- 2.5.4
- 2.5.4.1
- 2.5.4.15
- 2.5.4.3
- 2.5.4.6
- 2.5.4.13
- 2.5.4.46
- 2.5.29.35
- 2.16.840.1.113730.1.2
- 2.5.29.19
- 2.16.840.1.113730.1.6
- 2.16.840.1.113730.1.5
- 2.16.840.1.113730.1.8
- 2.16.840.1.113730.1.4
- 2.5.29.32
- 2.16.840.1.113730.1.13
- 2.16.840.1.113730.1.1
- 2.5.29.31
- 2.5.29.20
- 2.5.29.27
- 2.16.840.1.113730.1.10
- 2.5.29.37
- 2.5.29.46
- 2.5.29.23
- 2.16.840.1.113730.1.9
- 2.5.29.54
- 2.5.29.24
- 2.5.29.29
- 2.5.29.18
- 2.5.29.28
- 2.5.29.15
- 2.5.29.30
- 2.5.29.36
- 2.5.29.33
- 2.5.29.16
- 2.5.29.21
- 2.16.840.1.113730.1.7
- 2.16.840.1.113730.1.3
- 2.16.840.1.113730.1.12
- 2.5.29.17
- 2.5.29.14
- 2.16.840.1.113730.1.11
- 2.5.4.44
- 2.5.4.42
- 2.5.4.43
- 2.5.4.2
- 2.5.4.7
- 2.5.4.41
- 2.5.4.0
- 2.5.29.1
- 2.5.29.3
- 2.5.29.8
- 2.5.29.2
- 2.5.29.4
- 2.5.29.5
- 2.5.29.7
- 2.5.29.6
- 2.5.4.11
- 2.5.4.10
- 2.5.4.16
- 2.5.4.17
- 2.5.4.14
- 2.5.4.5
- 2.5.4.8
- 2.5.4.9
- 2.5.4.4
- 2.5.4.12
- 2.5.4.45
- 1.3.6.1.4.1.311.2.1.4
- 1.3.6.1.4.1.311.2.1.21
- 1.3.6.1.4.1.311.2.1.15
- 1.3.6.1.4.1.311.2.1.12
- 1.3.6.1.4.1.311.2.1.11
Functions§
- Format a OID to a
String
, using the provided registry to get the short name if present. - Generate a file containing a
with_<feat>
method for OidRegistry - Load a file to an OID description map
Type Aliases§
- Temporary structure, created when reading a file containing OID declarations