This commit is contained in:
2022-10-22 12:03:53 +02:00
parent d9a5f65e09
commit 3dab9a5c1f
21 changed files with 196 additions and 193 deletions

View File

@ -6,28 +6,28 @@ import (
"math/big"
"time"
asn "github.com/InfiniteLoopSpace/go_S-MIME/asn1"
cms "github.com/InfiniteLoopSpace/go_S-MIME/cms/protocol"
oid "github.com/InfiniteLoopSpace/go_S-MIME/oid"
asn "git.ma-al.com/goc_marek/go_S-MIME/asn1"
cms "git.ma-al.com/goc_marek/go_S-MIME/cms/protocol"
oid "git.ma-al.com/goc_marek/go_S-MIME/oid"
)
// TSTInfo ::= SEQUENCE {
// version INTEGER { v1(1) },
// policy TSAPolicyId,
// messageImprint MessageImprint,
// -- MUST have the same value as the similar field in
// -- TimeStampReq
// serialNumber INTEGER,
// -- Time-Stamping users MUST be ready to accommodate integers
// -- up to 160 bits.
// genTime GeneralizedTime,
// accuracy Accuracy OPTIONAL,
// ordering BOOLEAN DEFAULT FALSE,
// nonce INTEGER OPTIONAL,
// -- MUST be present if the similar field was present
// -- in TimeStampReq. In that case it MUST have the same value.
// tsa [0] GeneralName OPTIONAL,
// extensions [1] IMPLICIT Extensions OPTIONAL }
// TSTInfo ::= SEQUENCE {
// version INTEGER { v1(1) },
// policy TSAPolicyId,
// messageImprint MessageImprint,
// -- MUST have the same value as the similar field in
// -- TimeStampReq
// serialNumber INTEGER,
// -- Time-Stamping users MUST be ready to accommodate integers
// -- up to 160 bits.
// genTime GeneralizedTime,
// accuracy Accuracy OPTIONAL,
// ordering BOOLEAN DEFAULT FALSE,
// nonce INTEGER OPTIONAL,
// -- MUST be present if the similar field was present
// -- in TimeStampReq. In that case it MUST have the same value.
// tsa [0] GeneralName OPTIONAL,
// extensions [1] IMPLICIT Extensions OPTIONAL }
type TSTInfo struct {
Version int
Policy asn1.ObjectIdentifier

View File

@ -5,13 +5,13 @@ import (
"fmt"
"strings"
cms "github.com/InfiniteLoopSpace/go_S-MIME/cms/protocol"
cms "git.ma-al.com/goc_marek/go_S-MIME/cms/protocol"
)
// PKIStatusInfo ::= SEQUENCE {
// status PKIStatus,
// statusString PKIFreeText OPTIONAL,
// failInfo PKIFailureInfo OPTIONAL }
// PKIStatusInfo ::= SEQUENCE {
// status PKIStatus,
// statusString PKIFreeText OPTIONAL,
// failInfo PKIFailureInfo OPTIONAL }
type PKIStatusInfo struct {
Status int
StatusString PKIFreeText `asn1:"optional"`

View File

@ -12,19 +12,19 @@ import (
"encoding/asn1"
"math/big"
cms "github.com/InfiniteLoopSpace/go_S-MIME/cms/protocol"
oid "github.com/InfiniteLoopSpace/go_S-MIME/oid"
cms "git.ma-al.com/goc_marek/go_S-MIME/cms/protocol"
oid "git.ma-al.com/goc_marek/go_S-MIME/oid"
)
// TimeStampReq ::= SEQUENCE {
// version INTEGER { v1(1) },
// messageImprint MessageImprint,
// --a hash algorithm OID and the hash value of the data to be
// --time-stamped
// reqPolicy TSAPolicyId OPTIONAL,
// nonce INTEGER OPTIONAL,
// certReq BOOLEAN DEFAULT FALSE,
// extensions [0] IMPLICIT Extensions OPTIONAL }
// TimeStampReq ::= SEQUENCE {
// version INTEGER { v1(1) },
// messageImprint MessageImprint,
// --a hash algorithm OID and the hash value of the data to be
// --time-stamped
// reqPolicy TSAPolicyId OPTIONAL,
// nonce INTEGER OPTIONAL,
// certReq BOOLEAN DEFAULT FALSE,
// extensions [0] IMPLICIT Extensions OPTIONAL }
type TimeStampReq struct {
Version int
MessageImprint MessageImprint
@ -93,9 +93,9 @@ func (req TimeStampReq) Do(url string) (TimeStampResp, error) {
return ParseResponse(buf.Bytes())
}
//MessageImprint ::= SEQUENCE {
// hashAlgorithm AlgorithmIdentifier,
// hashedMessage OCTET STRING }
// MessageImprint ::= SEQUENCE {
// hashAlgorithm AlgorithmIdentifier,
// hashedMessage OCTET STRING }
type MessageImprint struct {
HashAlgorithm pkix.AlgorithmIdentifier
HashedMessage []byte

View File

@ -1,13 +1,13 @@
package timestamp
import (
asn "github.com/InfiniteLoopSpace/go_S-MIME/asn1"
cms "github.com/InfiniteLoopSpace/go_S-MIME/cms/protocol"
asn "git.ma-al.com/goc_marek/go_S-MIME/asn1"
cms "git.ma-al.com/goc_marek/go_S-MIME/cms/protocol"
)
//TimeStampResp ::= SEQUENCE {
// status PKIStatusInfo,
// timeStampToken TimeStampToken OPTIONAL }
// TimeStampResp ::= SEQUENCE {
// status PKIStatusInfo,
// timeStampToken TimeStampToken OPTIONAL }
type TimeStampResp struct {
Status PKIStatusInfo
TimeStampToken cms.ContentInfo `asn1:"optional"`

View File

@ -6,9 +6,9 @@ import (
"crypto/x509"
"time"
asn1 "github.com/InfiniteLoopSpace/go_S-MIME/asn1"
cms "github.com/InfiniteLoopSpace/go_S-MIME/cms/protocol"
oid "github.com/InfiniteLoopSpace/go_S-MIME/oid"
asn1 "git.ma-al.com/goc_marek/go_S-MIME/asn1"
cms "git.ma-al.com/goc_marek/go_S-MIME/cms/protocol"
oid "git.ma-al.com/goc_marek/go_S-MIME/oid"
)
const (