Squashed commit of the following:
commit 1f029f560d96e4c273fbbc6e85cde23956967521 Author: Tnze <cjd001113@outlook.com> Date: Wed Dec 7 11:42:39 2022 +0800 Adjust struct field name commit 3216cc964c87880cfe3d76492a6ad399cb5660e8 Author: patyhank <mlpmmy@gmail.com> Date: Wed Dec 7 11:25:28 2022 +0800 Change PublicKeySignature to V2 commit 3308bd67b29f7734344d83503d41960934f84086 Author: patyhank <mlpmmy@gmail.com> Date: Wed Dec 7 11:19:20 2022 +0800 Change PublicKeySignature to V2
This commit is contained in:
@ -22,9 +22,10 @@ type KeyPairResp struct {
|
|||||||
PrivateKey string `json:"privateKey"`
|
PrivateKey string `json:"privateKey"`
|
||||||
PublicKey string `json:"publicKey"`
|
PublicKey string `json:"publicKey"`
|
||||||
} `json:"keyPair"`
|
} `json:"keyPair"`
|
||||||
PublicKeySignature string `json:"publicKeySignature"`
|
PublicKeySignature string `json:"publicKeySignature"`
|
||||||
ExpiresAt time.Time `json:"expiresAt"`
|
PublicKeySignatureV2 string `json:"publicKeySignatureV2"`
|
||||||
RefreshedAfter time.Time `json:"refreshedAfter"`
|
ExpiresAt time.Time `json:"expiresAt"`
|
||||||
|
RefreshedAfter time.Time `json:"refreshedAfter"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k KeyPairResp) WriteTo(w io.Writer) (int64, error) {
|
func (k KeyPairResp) WriteTo(w io.Writer) (int64, error) {
|
||||||
@ -32,7 +33,7 @@ func (k KeyPairResp) WriteTo(w io.Writer) (int64, error) {
|
|||||||
if block == nil {
|
if block == nil {
|
||||||
return 0, errors.New("pem decode error: no data is found")
|
return 0, errors.New("pem decode error: no data is found")
|
||||||
}
|
}
|
||||||
signature, err := base64.StdEncoding.DecodeString(k.PublicKeySignature)
|
signature, err := base64.StdEncoding.DecodeString(k.PublicKeySignatureV2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user