mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-04 21:55:18 -04:00
completed string
This commit is contained in:
@ -1,9 +1,20 @@
|
||||
package common
|
||||
|
||||
/*
|
||||
I2P RouterIdentity
|
||||
https://geti2p.net/en/docs/spec/common-structures#struct_RouterIdentity
|
||||
Accurate for version 0.9.24
|
||||
|
||||
Identical to KeysAndCert
|
||||
*/
|
||||
|
||||
import (
|
||||
"github.com/bounce-chat/go-i2p/lib/crypto"
|
||||
)
|
||||
|
||||
//
|
||||
// A RouterIdentity is identical to KeysAndCert.
|
||||
//
|
||||
type RouterIdentity []byte
|
||||
|
||||
func (router_identity RouterIdentity) PublicKey() (crypto.PublicKey, error) {
|
||||
@ -18,7 +29,8 @@ func (router_identity RouterIdentity) Certificate() (Certificate, error) {
|
||||
return KeysAndCert(router_identity).Certificate()
|
||||
}
|
||||
|
||||
func ReadRouterIdentity(data []byte) (RouterIdentity, []byte, error) {
|
||||
keys_and_certs, remainder, err := ReadKeysAndCert(data)
|
||||
return RouterIdentity(keys_and_certs), remainder, err
|
||||
func ReadRouterIdentity(data []byte) (router_identity RouterIdentity, remainder []byte, err error) {
|
||||
keys_and_cert, remainder, err := ReadKeysAndCert(data)
|
||||
router_identity = RouterIdentity(keys_and_cert)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user