| 1 | package pkcs7scip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/ |
| 2 | |
| 3 | import ( |
| 4 | "encoding/asn1scip-go gomod github.com/golang/go/src go1.18 `encoding/asn1`/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 6 | "timescip-go gomod github.com/golang/go/src go1.18 time/" |
| 7 | |
| 8 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/" |
| 9 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/" |
| 10 | ) |
| 11 | |
| 12 | // marshal and unmarshal so FullBytes is set |
| 13 | func roundTripscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/roundTrip().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#, l AttributeListscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#) AttributeListscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList# { |
| 14 | t.Helperscip-go gomod github.com/golang/go/src go1.18 testing/common#Helper().() |
| 15 | raw, err := marshalUnsortedSetscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/marshalUnsortedSet().(l) |
| 16 | requirescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 17 | var l2 AttributeListscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList# |
| 18 | _, err = asn1scip-go gomod github.com/golang/go/src go1.18 `encoding/asn1`/.UnmarshalWithParamsscip-go gomod github.com/golang/go/src go1.18 `encoding/asn1`/UnmarshalWithParams().(raw, &l2, "set") |
| 19 | requirescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 20 | return l2 |
| 21 | } |
| 22 | |
| 23 | func TestAttributeListscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/TestAttributeList().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 24 | var l AttributeListscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList# |
| 25 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/False().(t, l.Existsscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#Exists().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime.)) |
| 26 | a := timescip-go gomod github.com/golang/go/src go1.18 time/.Datescip-go gomod github.com/golang/go/src go1.18 time/Date().(2000, 1, 1, 0, 0, 0, 0, timescip-go gomod github.com/golang/go/src go1.18 time/.UTCscip-go gomod github.com/golang/go/src go1.18 time/UTC.) |
| 27 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/NoError().(t, l.Addscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#Add().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime., a)) |
| 28 | ll := roundTripscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/roundTrip().(t, l) |
| 29 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/True().(t, ll.Existsscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#Exists().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime.)) |
| 30 | var x timescip-go gomod github.com/golang/go/src go1.18 time/.Timescip-go gomod github.com/golang/go/src go1.18 time/Time# |
| 31 | if assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/NoError().(t, ll.GetOnescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#GetOne().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime., &x)) { |
| 32 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/Equal().(t, a, x) |
| 33 | } |
| 34 | |
| 35 | b := a.AddDatescip-go gomod github.com/golang/go/src go1.18 time/Time#AddDate().(0, 0, 1) |
| 36 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/NoError().(t, l.Addscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#Add().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime., b)) |
| 37 | ll = roundTripscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/roundTrip().(t, l) |
| 38 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/Error().(t, ll.GetOnescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#GetOne().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime., &x)) |
| 39 | var times []timescip-go gomod github.com/golang/go/src go1.18 time/.Timescip-go gomod github.com/golang/go/src go1.18 time/Time# |
| 40 | if assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/NoError().(t, ll.GetAllscip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/AttributeList#GetAll().(OidAttributeSigningTimescip-go gomod github.com/sassoftware/relic/v7 . `github.com/sassoftware/relic/v7/lib/pkcs7`/OidAttributeSigningTime., ×)) { |
| 41 | assertscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/assert`/Equal().(t, []timescip-go gomod github.com/golang/go/src go1.18 time/.Timescip-go gomod github.com/golang/go/src go1.18 time/Time#{a, b}, times) |
| 42 | } |
| 43 | } |