cacert-gosigner/pkg/x509/helper/helper_test.go

16 lines
335 B
Go
Raw Normal View History

2022-09-18 10:17:27 +00:00
package helper_test
import (
"testing"
"git.cacert.org/cacert-gosigner/pkg/x509/helper"
"github.com/stretchr/testify/assert"
)
func TestGenerateRandomSerial(t *testing.T) {
rnd, err := helper.GenerateRandomSerial()
assert.NoError(t, err)
assert.LessOrEqual(t, rnd.BitLen(), 160)
assert.GreaterOrEqual(t, rnd.BitLen(), 153)
}