1
0
mirror of https://github.com/libp2p/go-openssl.git synced 2025-03-25 13:30:07 +08:00

Rename Type() to KeyType() to be more descriptive.

This commit is contained in:
Christopher Dudley 2017-12-15 16:01:44 -05:00 committed by Jeff
parent 193b24e768
commit 96ce3e554e

10
key.go
View File

@ -64,17 +64,17 @@ type PublicKey interface {
// format
MarshalPKIXPublicKeyDER() (der_block []byte, err error)
// Type returns an identifier for what kind of key is represented by this
// KeyType returns an identifier for what kind of key is represented by this
// object.
Type() KeyType
KeyType() KeyType
// BaseType returns an identifier for what kind of key is represented
// by this object.
// Keys that share same algorithm but use different legacy formats
// will have the same BaseType.
//
// For example, a key with a `Type() == KeyTypeRSA` and a key with a
// `Type() == KeyTypeRSA2` would both have `BaseType() == KeyTypeRSA`.
// For example, a key with a `KeyType() == KeyTypeRSA` and a key with a
// `KeyType() == KeyTypeRSA2` would both have `BaseType() == KeyTypeRSA`.
BaseType() KeyType
evpPKey() *C.EVP_PKEY
@ -101,7 +101,7 @@ type pKey struct {
func (key *pKey) evpPKey() *C.EVP_PKEY { return key.key }
func (key *pKey) Type() KeyType {
func (key *pKey) KeyType() KeyType {
return KeyType(C.EVP_PKEY_id(key.key))
}