Implement signed data calculating function from SignedDataReader

This commit is contained in:
Leonard Lyubich 2020-05-11 17:28:44 +03:00
parent ab198b4049
commit e01fb0cc62
10 changed files with 126 additions and 149 deletions

View file

@ -123,11 +123,7 @@ func (m *Token) AddSignKey(sig []byte, _ *ecdsa.PublicKey) {
// SignedData returns token information in a binary representation.
func (m *Token) SignedData() ([]byte, error) {
data := make([]byte, m.SignedDataSize())
copyTokenSignedData(data, m)
return data, nil
return SignedDataFromReader(m)
}
// ReadSignedData copies a binary representation of the token information to passed buffer.