Uh oh!
There was an error while loading. Please reload this page.
x509-cert: impl DecodeValue for Time - #1986
Merged
Merged
Conversation
baloo
marked this pull request as draft
August 6, 2025 17:50
baloo
commented
Aug 6, 2025
MemberAuthor
Likely something that can be done in the der_derive rather. |
baloo
marked this pull request as ready for review
August 6, 2025 18:47
baloo
commented
Aug 6, 2025
MemberAuthor
It's done this way in |
tarcieri
commented
Aug 6, 2025
Member
Is there a reason the derive isn't working? |
baloo
commented
Aug 6, 2025
MemberAuthor
it does work, I'm just not sure it's complete. (I'm not sure I completely grasp the custom_class behavior). |
balooforce-pushed
the
baloo/x509-cert/decode-value-time
branch
from
August 6, 2025 20:19
5a54260 to
ea3bfd3Comparetarcieri
reviewed
Aug 6, 2025
Uh oh!
There was an error while loading. Please reload this page.
tarcieri
approved these changes
Aug 6, 2025
To deserialize SigningTime attributes from CMS, Time needs implement DecodeValue.a
```
-- rfc3852
Attribute ::= SEQUENCE {
attrType OBJECT IDENTIFIER,
attrValues SET OF AttributeValue }
AttributeValue ::= ANY
-- rfc5911
SigningTime ::= Time
Time ::= CHOICE {
utcTime UTCTime,
generalTime GeneralizedTime }
aa-signingTime ATTRIBUTE ::=
{ TYPE SigningTime IDENTIFIED BY id-signingTime }
id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 }
```
This adds the missing implementation.balooforce-pushed
the
baloo/x509-cert/decode-value-time
branch
from
August 6, 2025 20:39
ea3bfd3 to
046bfb6CompareUh oh!
There was an error while loading. Please reload this page.
Merged
tarcieri added a commit
that referenced
this pull request
Feb 11, 2026
## Added - `Sequence`, `Enumerated` and `Choice` macros now support `#[asn1(error = Ty)]` attribute that provides a custom error type for `Decode`/`DecodeValue` implementations (#1560) - `BitString` macro (#1720, #1733) - `DecodeValue`, `EncodeValue` macros (#1722) - Derive support for `APPLICATION` and `PRIVATE` tags (#1825) - Impl `DecodeValue` for `Choice` (#1986) ## Changed - Use `TryFrom` conversions for `asn1(type = ...)` (#1562) - Rewrite `EncodeValue::value_len` as simple addition (#1810) - Change OctetStringRef `&` handling due to `der` type changes (#1998, #2040, #2043)
baloo added a commit
to baloo/formats
that referenced
this pull request
Jul 6, 2026
Added - Serial number generator ([RustCrypto#1270]) - `DecodeValue` for `x509_cert::time::Time` ([RustCrypto#1986]) - `FromStr` for `x509_cert::time::Time` ([RustCrypto#1961]) - impl `Hash` for `Name` ([RustCrypto#1764]) - impl `Ord` for `CrlReason` ([RustCrypto#1869]) - `DirectoryString::BmpString` ([RustCrypto#1794]) - `Crl` builder ([RustCrypto#1759]) - `Time::now` method ([RustCrypto#1761]) - `Validity::infinity` helper ([RustCrypto#1528]) - `Validity::new` method ([RustCrypto#1529]) - Re-export `spki` types without `*Owned` suffixes ([RustCrypto#1534]) - `x509_cert::builder::AsyncBuilder` using `AsyncSigner` ([RustCrypto#1280]) Changed - Decompose `AsExtension` into `Criticality + AsExtension` ([RustCrypto#2109]) - Improve extension API flexibility and ergonomics ([RustCrypto#2120]) - Expose `Profile` in the `CrlBuilder` ([RustCrypto#1870]) - Ensure a serial number can be stored in a database ([RustCrypto#1868]) - Move the CSR builder `x509_cert::request` ([RustCrypto#1581]) - Rename `x509_cert::builder::Profile` to `BuilderProfile` ([RustCrypto#1514] && [RustCrypto#1517]) - `Name` is now a new type over `RdnSequence` ([RustCrypto#1499]) - make `RelativeDistinguishedName` fields private ([RustCrypto#1510]) - make `RdnSequence` fields private ([RustCrypto#1508]) - make (Tbs)`CertificateInner` fields private ([RustCrypto#1505]) - rename helpers to `get_extension`/`filter_extensions` ([RustCrypto#1497]) - `check_name_encoding` now allow extraneous components ([RustCrypto#1447]) - Accept RFC-invalid certificates as TrustAnchors ([RustCrypto#1403]) - Edition changed to 2024 and MSRV bumped to 1.85 ([RustCrypto#1689]) - Bump `rand` to `v0.10` ([RustCrypto#2212]) - Bump `der` to `v0.8` ([RustCrypto#2234]) - Bump `digest` to `v0.11` ([RustCrypto#2237]) - Bump `sha2` to `v0.11` ([RustCrypto#2273]) - Bump `spki` to `v0.8` ([RustCrypto#2277]) - Bump `signature` to `v3` ([RustCrypto#2326]) Fixed - Converting from `SystemTime` should use `UtcTime` if date <= 2049 ([RustCrypto#1969]) - Underflow on empty input in `Certificate::load_pem_chain` ([RustCrypto#1965]) - Domain validated should accept CNs ([RustCrypto#1815]) - Serialization of email addresses ([RustCrypto#1425]) Removed - Std requirement for `x509_cert::builder` ([RustCrypto#1709]) - `RelativeDistinguishedName::encode_from_string` ([RustCrypto#1509]) [RustCrypto#1270]: RustCrypto#1270 [RustCrypto#1280]: RustCrypto#1280 [RustCrypto#1403]: RustCrypto#1403 [RustCrypto#1425]: RustCrypto#1425 [RustCrypto#1447]: RustCrypto#1447 [RustCrypto#1497]: RustCrypto#1497 [RustCrypto#1499]: RustCrypto#1499 [RustCrypto#1505]: RustCrypto#1505 [RustCrypto#1508]: RustCrypto#1508 [RustCrypto#1509]: RustCrypto#1509 [RustCrypto#1510]: RustCrypto#1510 [RustCrypto#1514]: RustCrypto#1514 [RustCrypto#1517]: RustCrypto#1517 [RustCrypto#1528]: RustCrypto#1528 [RustCrypto#1529]: RustCrypto#1529 [RustCrypto#1534]: RustCrypto#1534 [RustCrypto#1581]: RustCrypto#1581 [RustCrypto#1689]: RustCrypto#1689 [RustCrypto#1709]: RustCrypto#1709 [RustCrypto#1759]: RustCrypto#1759 [RustCrypto#1761]: RustCrypto#1761 [RustCrypto#1764]: RustCrypto#1764 [RustCrypto#1794]: RustCrypto#1794 [RustCrypto#1815]: RustCrypto#1815 [RustCrypto#1868]: RustCrypto#1868 [RustCrypto#1869]: RustCrypto#1869 [RustCrypto#1870]: RustCrypto#1870 [RustCrypto#1961]: RustCrypto#1961 [RustCrypto#1965]: RustCrypto#1965 [RustCrypto#1969]: RustCrypto#1969 [RustCrypto#1986]: RustCrypto#1986 [RustCrypto#2109]: RustCrypto#2109 [RustCrypto#2120]: RustCrypto#2120 [RustCrypto#2212]: RustCrypto#2212 [RustCrypto#2234]: RustCrypto#2234 [RustCrypto#2237]: RustCrypto#2237 [RustCrypto#2273]: RustCrypto#2273 [RustCrypto#2277]: RustCrypto#2277 [RustCrypto#2326]: RustCrypto#2326
Merged
baloo added a commit
to baloo/formats
that referenced
this pull request
Jul 6, 2026
Added - Serial number generator ([RustCrypto#1270]) - `DecodeValue` for `x509_cert::time::Time` ([RustCrypto#1986]) - `FromStr` for `x509_cert::time::Time` ([RustCrypto#1961]) - impl `Hash` for `Name` ([RustCrypto#1764]) - impl `Ord` for `CrlReason` ([RustCrypto#1869]) - `DirectoryString::BmpString` ([RustCrypto#1794]) - `Crl` builder ([RustCrypto#1759]) - `Time::now` method ([RustCrypto#1761]) - `Validity::infinity` helper ([RustCrypto#1528]) - `Validity::new` method ([RustCrypto#1529]) - Re-export `spki` types without `*Owned` suffixes ([RustCrypto#1534]) - `x509_cert::builder::AsyncBuilder` using `AsyncSigner` ([RustCrypto#1280]) Changed - Decompose `AsExtension` into `Criticality + AsExtension` ([RustCrypto#2109]) - Improve extension API flexibility and ergonomics ([RustCrypto#2120]) - Expose `Profile` in the `CrlBuilder` ([RustCrypto#1870]) - Ensure a serial number can be stored in a database ([RustCrypto#1868]) - Move the CSR builder `x509_cert::request` ([RustCrypto#1581]) - Rename `x509_cert::builder::Profile` to `BuilderProfile` ([RustCrypto#1514] && [RustCrypto#1517]) - `Name` is now a new type over `RdnSequence` ([RustCrypto#1499]) - make `RelativeDistinguishedName` fields private ([RustCrypto#1510]) - make `RdnSequence` fields private ([RustCrypto#1508]) - make (Tbs)`CertificateInner` fields private ([RustCrypto#1505]) - rename helpers to `get_extension`/`filter_extensions` ([RustCrypto#1497]) - `check_name_encoding` now allow extraneous components ([RustCrypto#1447]) - Accept RFC-invalid certificates as TrustAnchors ([RustCrypto#1403]) - Edition changed to 2024 and MSRV bumped to 1.85 ([RustCrypto#1689]) - Bump `rand` to `v0.10` ([RustCrypto#2212]) - Bump `der` to `v0.8` ([RustCrypto#2234]) - Bump `digest` to `v0.11` ([RustCrypto#2237]) - Bump `sha2` to `v0.11` ([RustCrypto#2273]) - Bump `spki` to `v0.8` ([RustCrypto#2277]) - Bump `signature` to `v3` ([RustCrypto#2326]) Fixed - Converting from `SystemTime` should use `UtcTime` if date <= 2049 ([RustCrypto#1969]) - Underflow on empty input in `Certificate::load_pem_chain` ([RustCrypto#1965]) - Domain validated should accept CNs ([RustCrypto#1815]) - Serialization of email addresses ([RustCrypto#1425]) Removed - Std requirement for `x509_cert::builder` ([RustCrypto#1709]) - `RelativeDistinguishedName::encode_from_string` ([RustCrypto#1509]) [RustCrypto#1270]: RustCrypto#1270 [RustCrypto#1280]: RustCrypto#1280 [RustCrypto#1403]: RustCrypto#1403 [RustCrypto#1425]: RustCrypto#1425 [RustCrypto#1447]: RustCrypto#1447 [RustCrypto#1497]: RustCrypto#1497 [RustCrypto#1499]: RustCrypto#1499 [RustCrypto#1505]: RustCrypto#1505 [RustCrypto#1508]: RustCrypto#1508 [RustCrypto#1509]: RustCrypto#1509 [RustCrypto#1510]: RustCrypto#1510 [RustCrypto#1514]: RustCrypto#1514 [RustCrypto#1517]: RustCrypto#1517 [RustCrypto#1528]: RustCrypto#1528 [RustCrypto#1529]: RustCrypto#1529 [RustCrypto#1534]: RustCrypto#1534 [RustCrypto#1581]: RustCrypto#1581 [RustCrypto#1689]: RustCrypto#1689 [RustCrypto#1709]: RustCrypto#1709 [RustCrypto#1759]: RustCrypto#1759 [RustCrypto#1761]: RustCrypto#1761 [RustCrypto#1764]: RustCrypto#1764 [RustCrypto#1794]: RustCrypto#1794 [RustCrypto#1815]: RustCrypto#1815 [RustCrypto#1868]: RustCrypto#1868 [RustCrypto#1869]: RustCrypto#1869 [RustCrypto#1870]: RustCrypto#1870 [RustCrypto#1961]: RustCrypto#1961 [RustCrypto#1965]: RustCrypto#1965 [RustCrypto#1969]: RustCrypto#1969 [RustCrypto#1986]: RustCrypto#1986 [RustCrypto#2109]: RustCrypto#2109 [RustCrypto#2120]: RustCrypto#2120 [RustCrypto#2212]: RustCrypto#2212 [RustCrypto#2234]: RustCrypto#2234 [RustCrypto#2237]: RustCrypto#2237 [RustCrypto#2273]: RustCrypto#2273 [RustCrypto#2277]: RustCrypto#2277 [RustCrypto#2326]: RustCrypto#2326
tarcieri added a commit
that referenced
this pull request
Jul 9, 2026
## Added - Serial number generator (#1270) - `DecodeValue` for `x509_cert::time::Time` (#1986) - `FromStr` for `x509_cert::time::Time` (#1961) - impl `Hash` for `Name` (#1764) - impl `Ord` for `CrlReason` (#1869) - `DirectoryString::BmpString` (#1794) - `Crl` builder (#1759) - `Time::now` method (#1761) - `Validity::infinity` helper (#1528) - `Validity::new` method (#1529) - Re-export `spki` types without `*Owned` suffixes (#1534) - `x509_cert::builder::AsyncBuilder` using `AsyncSigner` (#1280) ## Changed - Decompose `AsExtension` into `Criticality + AsExtension` (#2109) - Improve extension API flexibility and ergonomics (#2120) - Expose `Profile` in the `CrlBuilder` (#1870) - Ensure a serial number can be stored in a database (#1868) - Move the CSR builder `x509_cert::request` (#1581) - Rename `x509_cert::builder::Profile` to `BuilderProfile` (#1514, #1517) - `Name` is now a new type over `RdnSequence` (#1499) - make `RelativeDistinguishedName` fields private (#1510) - make `RdnSequence` fields private (#1508) - make (Tbs)`CertificateInner` fields private (#1505) - rename helpers to `get_extension`/`filter_extensions` (#1497) - `check_name_encoding` now allow extraneous components (#1447) - Accept RFC-invalid certificates as TrustAnchors (#1403) - Edition changed to 2024 and MSRV bumped to 1.85 (#1689) - Bump `rand` to `v0.10` (#2212) - Bump `der` to `v0.8` (#2234) - Bump `digest` to `v0.11` (#2237) - Bump `sha2` to `v0.11` (#2273) - Bump `spki` to `v0.8` (#2277) - Bump `signature` to `v3` (#2326) ## Fixed - Converting from `SystemTime` should use `UtcTime` if date <= 2049 (#1969) - Underflow on empty input in `Certificate::load_pem_chain` (#1965) - Domain validated should accept CNs (#1815) - Serialization of email addresses (#1425) ## Removed - `std` requirement for `x509_cert::builder` (#1709) - `RelativeDistinguishedName::encode_from_string` (#1509) Co-authored-by: Tony Arcieri <bascule@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To deserialize SigningTime attributes from CMS, Time needs implement DecodeValue.
This adds the missing implementation.