42 writeConstructed( stream, sizeofObject( length ), tag );
53 ( pkcs15infoPtr->
dataType == CRYPT_IATTRIBUTE_USERINFO ) ? \
56 const int labelSize = \
68 sizeofObject( labelSize ) + \
81 ( pkcs15infoPtr->
dataType == CRYPT_IATTRIBUTE_CONFIGDATA ) ? \
83 ( pkcs15infoPtr->
dataType == CRYPT_IATTRIBUTE_USERINDEX ) ? \
85 const int labelSize = \
88 const int contentSize =
sizeofOID( oid ) + \
89 ( ( pkcs15infoPtr->
dataType == CRYPT_IATTRIBUTE_USERINFO ) ? \
97 pkcs15infoPtr->
dataType == CRYPT_IATTRIBUTE_USERINDEX || \
98 pkcs15infoPtr->
dataType == CRYPT_IATTRIBUTE_USERINFO );
102 writeConstructed( stream, \
103 sizeofObject( labelSize ) + \
105 sizeofObject( sizeofObject( contentSize ) ),
107 writeSequence( stream, labelSize );
109 writeCharacterString( stream, (
BYTE * ) pkcs15infoPtr->label,
113 writeConstructed( stream, (
int ) sizeofObject( contentSize ),
115 writeSequence( stream, contentSize );
117 if( pkcs15infoPtr->
dataType != CRYPT_IATTRIBUTE_USERINFO )
123 return( swrite( stream, pkcs15infoPtr->dataData, \
134 int pubKeySize = 0,
privKeySize = 0, certSize = 0, dataSize = 0;
135 int objectsSize = 0, i,
status;
147 switch( pkcs15info[ i ].
type )
153 pubKeySize += pkcs15info[ i ].pubKeyDataSize;
158 certSize += pkcs15info[ i ].certDataSize;
168 status = sizeofDataItem( &pkcs15info[ i ], &length );
179 ENSURES( i < FAILSAFE_ITERATIONS_MED );
184 objectsSize += sizeofObject( sizeofObject( pubKeySize ) );
186 objectsSize += sizeofObject( sizeofObject(
privKeySize ) );
188 objectsSize += sizeofObject( sizeofObject( certSize ) );
190 objectsSize += sizeofObject( sizeofObject( dataSize ) );
191 if( objectsSize <= 0 )
199 sizeofObject( objectsSize ),
FALSE );
203 status = writeSequence( stream, objectsSize );
210 if( pkcs15info[ i ].privKeyDataSize > 0 )
211 status = swrite( stream, pkcs15info[ i ].privKeyData,
212 pkcs15info[ i ].privKeyDataSize );
214 ENSURES( i < FAILSAFE_ITERATIONS_MED );
218 status = writeObjectWrapper( stream, pubKeySize,
CTAG_PO_PUBKEY );
222 if( pkcs15info[ i ].pubKeyDataSize > 0 )
223 status = swrite( stream, pkcs15info[ i ].pubKeyData,
224 pkcs15info[ i ].pubKeyDataSize );
226 ENSURES( i < FAILSAFE_ITERATIONS_MED );
230 status = writeObjectWrapper( stream, certSize,
CTAG_PO_CERT );
235 pkcs15info[ i ].certDataSize > 0 ) || \
237 status = swrite( stream, pkcs15info[ i ].certData,
238 pkcs15info[ i ].certDataSize );
240 ENSURES( i < FAILSAFE_ITERATIONS_MED );
244 status = writeObjectWrapper( stream, dataSize,
CTAG_PO_DATA );
248 if( pkcs15info[ i ].dataDataSize > 0 )
249 status = writeDataItem( stream, &pkcs15info[ i ] );
251 ENSURES( i < FAILSAFE_ITERATIONS_MED );
255 return(
sflush( stream ) );