aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/x509/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptography/x509/base.py')
-rw-r--r--src/cryptography/x509/base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cryptography/x509/base.py b/src/cryptography/x509/base.py
index 498ccbb9..ffa71916 100644
--- a/src/cryptography/x509/base.py
+++ b/src/cryptography/x509/base.py
@@ -6,6 +6,7 @@ from __future__ import absolute_import, division, print_function
import abc
import datetime
+import os
from enum import Enum
import six
@@ -723,3 +724,7 @@ class RevokedCertificateBuilder(object):
)
return backend.create_x509_revoked_certificate(self)
+
+
+def random_serial_number():
+ return utils.int_from_bytes(os.urandom(20), "big") >> 1