<s> from kmip . core . enums import Tags <EOL> from kmip . core . primitives import Struct <EOL> from kmip . core . primitives import ByteString <EOL> from kmip . core . utils import BytearrayStream <EOL> class RawKey ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( RawKey , self ) . __init__ ( value , Tags . KEY_MATERIAL ) <EOL> class OpaqueKey ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( OpaqueKey , self ) . __init__ ( value , Tags . KEY_MATERIAL ) <EOL> class PKCS1Key ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( PKCS1Key , self ) . __init__ ( value , Tags . KEY_MATERIAL ) <EOL> class PKCS8Key ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( PKCS8Key , self ) . __init__ ( value , Tags . KEY_MATERIAL ) <EOL> class X509Key ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( X509Key , self ) . __init__ ( value , Tags . KEY_MATERIAL ) <EOL> class ECPrivateKey ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( ECPrivateKey , self ) . __init__ ( value , Tags . KEY_MATERIAL ) <EOL> class TransparentSymmetricKey ( Struct ) : <EOL> class Key ( ByteString ) : <EOL> def __init__ ( self , value = None ) : <EOL> super ( TransparentSymmetricKey . Key , self ) . __init__ ( value , Tags . KEY ) <EOL> def __init__ ( self , key = None ) : <EOL> super ( TransparentSymmetricKey , self ) . __init__ ( Tags . KEY_MATERIAL ) <EOL> self . key = key <EOL> self . validate ( ) <EOL> def read ( self , istream ) : <EOL> super ( TransparentSymmetricKey , self ) . read ( istream ) <EOL> tstream = BytearrayStream ( istream . read ( self . length ) ) <EOL> self . key = TransparentSymmetricKey . Key ( ) <EOL> self . key . read ( tstream ) <EOL> self . is_oversized ( tstream ) <EOL> self . validate ( ) <EOL> def write ( self , ostream ) : <EOL> tstream = BytearrayStream ( ) <EOL> self . key . write ( tstream ) <EOL> self . length = tstream . length ( ) <EOL> super ( TransparentSymmetricKey , self ) . write ( ostream ) <EOL> ostream . write ( tstream . buffer ) <EOL> def validate ( self ) : <EOL> self . __validate ( ) <EOL> def __validate ( self ) : <EOL> pass </s>
