mirror of
https://github.com/libp2p/go-openssl.git
synced 2026-08-22 15:23:28 +08:00
Rename Type() to KeyType() to be more descriptive.
This commit is contained in:
10
key.go
10
key.go
@@ -64,17 +64,17 @@ type PublicKey interface {
|
|||||||
// format
|
// format
|
||||||
MarshalPKIXPublicKeyDER() (der_block []byte, err error)
|
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.
|
// object.
|
||||||
Type() KeyType
|
KeyType() KeyType
|
||||||
|
|
||||||
// BaseType returns an identifier for what kind of key is represented
|
// BaseType returns an identifier for what kind of key is represented
|
||||||
// by this object.
|
// by this object.
|
||||||
// Keys that share same algorithm but use different legacy formats
|
// Keys that share same algorithm but use different legacy formats
|
||||||
// will have the same BaseType.
|
// will have the same BaseType.
|
||||||
//
|
//
|
||||||
// For example, a key with a `Type() == KeyTypeRSA` and a key with a
|
// For example, a key with a `KeyType() == KeyTypeRSA` and a key with a
|
||||||
// `Type() == KeyTypeRSA2` would both have `BaseType() == KeyTypeRSA`.
|
// `KeyType() == KeyTypeRSA2` would both have `BaseType() == KeyTypeRSA`.
|
||||||
BaseType() KeyType
|
BaseType() KeyType
|
||||||
|
|
||||||
evpPKey() *C.EVP_PKEY
|
evpPKey() *C.EVP_PKEY
|
||||||
@@ -101,7 +101,7 @@ type pKey struct {
|
|||||||
|
|
||||||
func (key *pKey) evpPKey() *C.EVP_PKEY { return key.key }
|
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))
|
return KeyType(C.EVP_PKEY_id(key.key))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user