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
feat(common): KeyConverter class to and from PEM/hex/buffe #255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
31edc65
to
b358980
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
54d8a26
to
06af537
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid some class files are misplaced. I would like to hear assumed usage of those classes.
I also suggested some changes to align standard library like Web Crypto API or nodeJS crypto lib.
Signed-off-by: suyukuoacn <su-yu.kuo@accenture.com>
06af537
to
d3d54b1
Compare
|
||
export enum KeyFormat { | ||
Raw = "raw", | ||
Hex = "hex", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think original code https://github.com/blockstack/key-encoder-js defined this as 'der'. Can you use same value to avoid confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently Cactus’s key converter does not support 'DER' format.
Here's list of format and enum for the Cactus and the external key encoder representation.
PEM Format - Cactus' enum 'PEM', - Key-Encoder's enum 'PEM'
DER Format - Cactus not support, - Key-Encoder's enum 'DER'
HEX Format - Cactus' enum 'HEX', - Key-Encoder's enum 'RAW'
Buffer/Unit8Array Format - Cactus' enum 'RAW', - Key-Encoder not support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment intended to use a meaningful name for the format.
Actually key-encoder obviously supports DER(Distinguished Encoding Rule), which is the official name for the format.
Please refer related description at https://github.com/blockstack/key-encoder-js#encoding-public-keys
I believe you are aligned to the library used, but I just hope to have consistent names that represent their data format actually used.
Suggested | CACTUS | DataEncoder | Description |
---|---|---|---|
PEM | PEM | PEM | PEM format |
DER | (none) | RAW | portable binary format |
HEX | HEX | (none) | typescript value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Sorry for my misunderstanding.r
Is there any reason to eliminate the DER format which widely is used at may key management implementations.
I will approve this PR, but I will create new issue to support DER, for the case to support portable keys for va
I will create new issue for support DER format, then approve this PR for moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check my comment reagarding 'hex' format ?
If using 'hex' is correct way format, then I will revoke my comment.
I will withdraw my comment. |
I will withdraw my comment. |
I will withdraw my comment see my new comment below. |
@sfuji822 Why did you close the pull request? Misclick? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create a new item on the issue list, and I will pass this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[](#278)
@yochliu8 Sorry I don't get it. Could you please clarify? |
This PR resolve issue #247
This PR depend on PR #245 and #246 as it uses functionality and test from other PRs.