This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24825 - Add procedures for encoding ASN.1 structures
Summary: Add procedures for encoding ASN.1 structures
Status: RESOLVED FIXED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ryan Sleevi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-26 20:55 UTC by Mark Watson
Modified: 2014-02-26 21:49 UTC (History)
1 user (show)

See Also:


Attachments

Description Mark Watson 2014-02-26 20:55:13 UTC
We need procedures to encode the subjectPublicKeyInfo and privateKeyInfo ASN.1 structures.
Comment 1 Mark Watson 2014-02-26 21:02:46 UTC
Changeset 19be0e9a2f81
Comment 2 Ryan Sleevi 2014-02-26 21:27:29 UTC
https://dvcs.w3.org/hg/webcrypto-api/rev/19be0e9a2f81 doesn't really resolve the issue; it describes a generic algorithm, except that algorithm doesn't really work for any of the ASN.1 structures.

Plus, the whole recursive nature of CHOICE, ANY, etc are unnecessary for the actual conversion.
Comment 3 Mark Watson 2014-02-26 21:49:21 UTC
(In reply to Ryan Sleevi from comment #2)
> https://dvcs.w3.org/hg/webcrypto-api/rev/19be0e9a2f81 doesn't really resolve
> the issue; it describes a generic algorithm, except that algorithm doesn't
> really work for any of the ASN.1 structures.
> 
> Plus, the whole recursive nature of CHOICE, ANY, etc are unnecessary for the
> actual conversion.

CHOICE yes, because the structures we care about don't have CHOICE members.

ANY does not recurse - it expects the member to be already converted because only the procedure using this encoding procedure knows the correct abstract syntax (unless we have this generic procedure look up the OID in a table).

SEQUENCE needs to recurse because we have SEQUENCES that contain SEQUENCES.

Can you explain why it doesn't work ?

An alternative would be to specify a logical mapping between members of the ASN.1 abstract syntax structure and members of an internal object structure and then just say "encode this with that" in one step. The definition of that mapping would still need the same recursion.