-
Notifications
You must be signed in to change notification settings - Fork 1
/
serializer.go
31 lines (23 loc) · 945 Bytes
/
serializer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright Chainify Group LTD. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package serialization
import (
"github.com/chainifynet/aws-encryption-sdk-go/pkg/model/format"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/suite"
)
type Serializer struct{}
func NewSerializer() format.Serializer {
return &Serializer{}
}
func (s *Serializer) SerializeHeader(p format.HeaderParams) (format.MessageHeader, error) {
return newHeader(p)
}
func (s *Serializer) SerializeHeaderAuth(v suite.MessageFormatVersion, iv, authData []byte) (format.MessageHeaderAuth, error) {
return newHeaderAuth(v, iv, authData)
}
func (s *Serializer) SerializeBody(alg *suite.AlgorithmSuite, frameLength int) (format.MessageBody, error) {
return newBody(alg, frameLength)
}
func (s *Serializer) SerializeFooter(alg *suite.AlgorithmSuite, signature []byte) (format.MessageFooter, error) {
return newFooter(alg, signature)
}