Cargo Features
[dependencies]
pk11-uri-parser = { version = "0.1.5", default-features = false, features = ["validation", "debug_warnings"] }
- default = debug_warnings, validation
-
The default feature set is to always perform validation and to provide
pkcs11 warning:
messages for debug builds (assuming an attribute's value does not comply with RFC7512 "SHOULD/SHOULD NOT" guidelines).It's perfectly reasonable for
--release
builds to not require any runtime validation (and its slight bit of overhead), so simply annotate your dependency usingdefault-features = false
, but be aware that doing so introducesexpect("my expectation")
calls. - validation default
-
The RFC7512 specification defines criteria for acceptable attribute values. This feature evaluates attribute values and enforces validity. The library will issue a
PK11URIError
if a value violates the specification's rules. - debug_warnings default
-
The RFC7512 specification provides optional, best-practice suggestions for attribute values (and vendor-specific naming). This feature evaluates attribute values and will emit
pkcs11 warning:
messages when said messages do not comply with the specification's "SHOULD/SHOULD NOT" (etc.) guidelines. As the feature name implies, this feature is only relevant for debug builds; warning related code is explicitly excluded from--release
builds.