formats
formats copied to clipboard
der: implementing other tag classes than Context-Specific
Hello,
first of all thanks for the crate.
I need to parse (and also write) serialized asn1 sequences, where the tags are given as application tag classes, i.e.:
InitiateSession ::= [APPLICATION 0] IMPLICIT SEQUENCE {
sid-a [APPLICATION 10] IMPLICIT OCTET STRING (SIZE(8..32)),
login-protocol-list [APPLICATION 11] IMPLICIT OCTET STRING,
system-use-text [APPLICATION 31] IMPLICIT UTF8String (SIZE(1..512)) OPTIONAL,
server-msg-buf-size [APPLICATION 32] IMPLICIT OCTET STRING (SIZE(2..2)) OPTIONAL
}
I do not think this is already possible with this library? I only found the distinguishing between context-specific and universal tags when you want to encode a struct (with derives) to der. Are there plan to implement that? https://github.com/RustCrypto/formats/blob/b20d644ad718db22618205bd0c1854c12e9bfe0e/der/derive/src/tag.rs#L13
We don’t currently have plans to implement this, and generally implement features as needed by the cryptographic formats implemented in this repo.
What format are you trying to implement?
I am trying to implement that in DER format.
I was asking the name of the protocol you are trying to implement, i.e. where is that schema defined, and what protocol is it a message for?
Ah - sorry. Misunderstood. We use X.509 and custom ones. But in X.509 you do not have application tags, I think. So maybe this is the wrong place, if you only implement features needed for cryptographic formats.
But anyway - thanks for the fast response. I'll close the issue then.
We’re happy to accept PRs for additional functionality that goes beyond the formats we’re actively implementing. It’s just not something we’re planning on implementing ourselves any time soon
I think the issue is still valuable because of the kerberos protocol requirement.
The remarkable thing is that it needs the APPLICATION as toplevel attribute, not field level.