-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add p11ez package. #56
Conversation
This package wraps the main package in an easier and more idiomatic layer, breaking out Go types that match some of the various concepts in PKCS#11.
p11ez is p11easy? Why not shorten it to just p11? |
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.
Code looks good. Mostly comments on naming - I think we should push this as far as possible to the Go standard of naming.
p11ez/module.go
Outdated
} | ||
|
||
// GetInfo returns general information about the module. | ||
func (m Module) GetInfo() (pkcs11.Info, error) { |
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.
'Get' is not really idiomatic, just Info() and (if there is such a thing) SetInfo()
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.
Good idea, will do this tomorrow.
p11ez/module.go
Outdated
} | ||
|
||
// Module represents a PKCS#11 module, and can be used to create Sessions. | ||
type Module struct { |
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.
Should we nanme this Context? Or would that be too confusing with context.Context?
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 it would be too confusing with context.Context
.
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.
Ack
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.
Yep looks good. We should do a
sed s/p11ex/p11
think just p11
is both simple, descriptive and short
@jsha I really think we should just call this is |
Oh, right, sorry I forgot about this! Yes, I agree, and I have a few other
refinements waiting to be pushed along with the rename.
…On Nov 14, 2017 23:26, "Miek Gieben" ***@***.***> wrote:
@jsha <https://github.com/jsha> I really think we should just call this
is p11 instead of p11ez. What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AANcLc-3l7vmf9g3eyIIZjS6KQZwJoztks5s2pI2gaJpZM4P5QhA>
.
|
@jsha still working on this? |
Thanks for the reminder! I still have the branch, will try and remember to
push it soon. :-)
…On Thu, Feb 8, 2018 at 3:43 AM, Miek Gieben ***@***.***> wrote:
@jsha <https://github.com/jsha> still working on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AANcLR8KIHJHqNMMd25qc6Da0GiTLdYxks5tSt3HgaJpZM4P5QhA>
.
|
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.
Any news? on this PR?
Sorry for the delay, all! I went ahead and pushed up what I had sitting in my local repo; I'll take another skim over things today and see where they stand. |
[ Quoting <notifications@github.com> in "Re: [miekg/pkcs11] Add p11ez packag..." ]
Sorry for the delay, all! I went ahead and pushed up what I had sitting in my local repo; I'll take another skim over things today and see where they stand.
+1
/Miek
…--
Miek Gieben
|
Ok, I did a round of self review, mostly fixing up comments, and I think this is ready for another round of review. One thing in particular I'm interested in feedback on: I'd like this package to be pretty flexible for most use cases, but not necessarily a full mirror of every function available in PKCS#11. For instance, I just removed |
I don't have an answer to your question, so I'll just merge :-) |
This package wraps the main package in an easier and more idiomatic layer,
breaking out Go types that match some of the various concepts in PKCS#11.
I'm definitely open to alternate package names, though I like that this one
has "ez" (like easy) in the name and could alternately be pronounced
"pleez." :-)
One additional piece of work I might want to do is replace all of the structs
with interfaces. This would make it easier to mock them out, and also easier
to provide cutouts for a build tag like in #47.