Skip to content

Commit

Permalink
p11: Add Mechanism.Type() and Mechanism.Parameter() (miekg#160)
Browse files Browse the repository at this point in the history
Fixes miekg#158

Co-authored-by: Jeremy Rand <[email protected]>
  • Loading branch information
JeremyRand and Jeremy Rand authored Sep 2, 2022
1 parent 9a05b23 commit 8bb176f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions p11/slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ type Mechanism struct {
slot Slot
}

// Type returns the type of mechanism.
func (m *Mechanism) Type() uint {
return m.mechanism.Mechanism
}

// Parameter returns any parameters required by the mechanism.
func (m *Mechanism) Parameter() []byte {
return m.mechanism.Parameter
}

// Info returns information about this mechanism.
func (m *Mechanism) Info() (pkcs11.MechanismInfo, error) {
return m.slot.ctx.GetMechanismInfo(m.slot.id, []*pkcs11.Mechanism{m.mechanism})
Expand Down

0 comments on commit 8bb176f

Please sign in to comment.