Encode ASN.1 types differently, on OTP >= 28 #14
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.
Problem
This PR tries to fix #13
We need to run different code on 28 as the old internal module does not exist anymore.
Solution
We have more stuff available in
public_keyso I use the public API when possible.For a couple of other types, I need to switch to a new internal module.
CertificateSerialNumber -> CRLNumber
By changing type, is possible to use the public_key API
public_key:der_encodeLooks safe to use on both 27 and 28
InvalidityDate
From OTP 28 it is available in
public_keyapiIa5String
Can be encoded as
'OTP-PKIX':encode('OTPDisplayText', {ia5String, String}),OID (ObjectIdentifier)
We can use CertPolicyId as
'OTP-PKIX':encode('CertPolicyId', OId),Tests
I manually tested grisp board connections to grisp.io, both with latest OTP 27 and OTP 28 👍