Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ› οΈ [TASK] : Implement encode decode for C509 type Name #589

Closed
6 tasks done
Tracked by #439
bkioshn opened this issue Jul 3, 2024 · 0 comments Β· Fixed by #604
Closed
6 tasks done
Tracked by #439

πŸ› οΈ [TASK] : Implement encode decode for C509 type Name #589

bkioshn opened this issue Jul 3, 2024 · 0 comments Β· Fixed by #604
Assignees
Labels
documentation Pull requests that update a dependency file. enhancement New feature or request

Comments

@bkioshn
Copy link
Contributor

bkioshn commented Jul 3, 2024

Summary

Implement encode decode for C509 type Name

Description

Implement encode, decode, and other important functionality for C509 type Name

Given

    Name = [ * RelativeDistinguishedName ] / text / bytes

    RelativeDistinguishedName = Attribute / [ 2* Attribute ]

    Attribute = ( attributeType: int, attributeValue: text ) //
                ( attributeType: ~oid, attributeValue: bytes ) //
                ( attributeType: pen, attributeValue: bytes )

This type Name will be used in various places like GeneralName, subject, and issuer

Note that Attribute is used in various places

      Attributes = ( attributeType: int, attributeValue: [+text] ) //
                   ( attributeType: ~oid, attributeValue: [+bytes] )
      SubjectDirectoryAttributes = [+Attributes]

Attribute used in RelativeDistinguishedName support PEN
Attribute used in Attributes doesn't support PEN and support multiple Attribute value

The implementation should follow the c509 documentation https://datatracker.ietf.org/doc/draft-ietf-cose-cbor-encoded-cert/09/

  • Create an Attribute type decode and encode where it will handle attributeType integer value, unwrapped OID, and PEN
  • Create a RelativeDistinguishedName type decode and encode
  • Create a Name type decode and encode
  • Modify the GeneralName to accept Name type
  • All special cases should be handled
  • Create tests for all use cases

Test cases

Attribute

  • Attribute should work for both RelativeDistinguishedName and Attributes.
  • Attribute should not have empty attributeValue
  • Attributes shoudl not be empty array
  • Each Attribute has corresponding integer value associated with the OID (Table 9.3)

Relative Distinguised Name (RDN)

  • If only > 1 attributes encode it as array

Name

  • 3 special cases for Name CommonName
  • Name can contains >= 0 RelativeDistinguisedName if theRelativeDistinguisedName is provided
@bkioshn bkioshn self-assigned this Jul 3, 2024
@bkioshn bkioshn moved this to πŸ— In progress in Catalyst Jul 3, 2024
@bkioshn bkioshn mentioned this issue Jul 10, 2024
8 tasks
@bkioshn bkioshn moved this from πŸ— In progress to πŸ‘€ In review in Catalyst Jul 10, 2024
@bkioshn bkioshn moved this from πŸ‘€ In review to πŸ”¬ Ready For QA in Catalyst Jul 12, 2024
@bkioshn bkioshn added documentation Pull requests that update a dependency file. dependencies Pull requests that update a dependency file enhancement New feature or request and removed dependencies Pull requests that update a dependency file labels Jul 19, 2024
@bkioshn bkioshn closed this as completed Jul 19, 2024
@bkioshn bkioshn moved this from πŸ”¬ Ready For QA to βœ… Done in Catalyst Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests that update a dependency file. enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant