2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-15 15:53:36 +00:00

Adding support for the Certificate managed object

This change polishes and reorganizes the implementation of the
Certificate managed object and its required subclasses. It adds in
documentation and test suites for all modified classes and updates the
SecretFactory to support creating default Certificate objects.
This commit is contained in:
Peter Hamilton
2015-05-05 14:55:34 -04:00
parent 883a36f22a
commit 195671d4bf
10 changed files with 607 additions and 31 deletions

View File

@@ -17,6 +17,7 @@ from kmip.core.enums import KeyFormatType as KeyFormatTypeEnum
from kmip.core.enums import Tags
from kmip.core.enums import QueryFunction as QueryFunctionEnum
from kmip.core.primitives import ByteString
from kmip.core.primitives import Enumeration
from kmip.core.primitives import Interval
from kmip.core.primitives import Struct
@@ -25,6 +26,27 @@ from kmip.core.primitives import TextString
from kmip.core.utils import BytearrayStream
class CertificateValue(ByteString):
"""
The bytes of a DER-encoded X.509 public key certificate.
Used by the Certificate Managed Object to store the bytes of the
certificate. See Section 2.2.1 of the KMIP 1.1. specification for more
information.
"""
def __init__(self, value=b''):
"""
Construct a CertificateValue byte string.
Args:
value (bytes): A byte string (e.g., b'\x00\x01...') containing the
certificate bytes to store. Optional, defaults to the empty
byte string.
"""
super(CertificateValue, self).__init__(value, Tags.CERTIFICATE_VALUE)
class Offset(Interval):
"""
An integer representing a positive change in time.