// SafeContents
// PARAM1: salt
// PARAM2: iteration count
// PARAM3: cipher_oid
// PARAM4: cipher
// PARAM5: key
// PARAM6: iv
// PARAM7: The filename of the DER encoded keyfile
// PARAM8: The name of the certificate file
// PARAM9: The 'friendly' name of the certificate
// SafeBag

// key bag

// key bag
SEQUENCE
	OID=PKCS12_BAGTYPES_KEYBAG
	EXPLICIT
		INCLUDE_BINARY_FILE=../root5ca_key.pk8
	END
	// Attributes
	SET
		SEQUENCE
			OID=PKCS9_LOCAL_KEYID
			SET
				OUTPUT_BINARY_FILE=cb004_localkeyid_secondkey.der,1			
					OCTETSTRING
						HASH=sha1
							INCLUDE_BINARY_FILE=../root5ca.der
						END
					END
				END
			END
		END 
		SEQUENCE
			OID=PKCS9_FRIENDLY_NAME
			SET
				OUTPUT_BINARY_FILE=cb004_friendlyname_secondkey.der,1
					BMPSTRING=symbian
				END
			END
		END	
	END
END




// cert bag


SEQUENCE
	OID=PKCS12_BAGTYPES_CERTBAG
	EXPLICIT
		// CertBag
		SEQUENCE
			OID=PKCS9_CERTTYPES_PKCS12_X509
			EXPLICIT
				OCTETSTRING
					INCLUDE_BINARY_FILE=../root5ca.der
				END
			END
		END
	END
	// Attributes
	SET
		SEQUENCE
			OID=PKCS9_LOCAL_KEYID
			SET
				OUTPUT_BINARY_FILE=cb004_localkeyid_secondcert.der,1			
					OCTETSTRING
						HASH=sha1
							INCLUDE_BINARY_FILE=../root5ca.der
						END
					END
				END
			END
		END 
		SEQUENCE
			OID=PKCS9_FRIENDLY_NAME
			SET
				OUTPUT_BINARY_FILE=cb004_friendlyname_secondcert.der,1
					BMPSTRING=symbian
				END
			END
		END	
	END
END



// crl bag

SEQUENCE
	OID=PKCS12_BAGTYPES_CRLBAG
	EXPLICIT=0
		// CRLBag
		SEQUENCE
			OID=X509CRL
			EXPLICIT=0
				OCTETSTRING
					INCLUDE_BINARY_FILE=../root5crl.der
				END
			END
		END
	END
	// Attributes
	SET
		SEQUENCE
			OID=PKCS9_FRIENDLY_NAME
			SET
				//OUTPUT_BINARY_FILE=friendlyname.der,1
					BMPSTRING=symbian
				//END
			END
		END	
	END
END

// secret bag

SEQUENCE
	OID=PKCS12_BAGTYPES_SECRETBAG
	EXPLICIT=0
		SEQUENCE
			OID=SYMBIAN_DEVICE_ID_LIST
			EXPLICIT=0
				SEQUENCE
					UTF8STRING=11111111-222222-3-44
				END
			END
		END
	END
	// No attributes
END


// shrouded key bag
SEQUENCE
	OID=PKCS12_BAGTYPES_PKCS8SHROUDEDKEYBAG
	EXPLICIT
		OUTPUT_BINARY_FILE=safebag_shrouded_cb004_2.der,1
			// KeyBag
			SEQUENCE
				SEQUENCE
					OID=$3
					SEQUENCE
						OCTETSTRING
							RAW=$1
						END
						INTEGER=$2
					END
				END
				OCTETSTRING
					ENCRYPT=$4,$5,$6
						INCLUDE_BINARY_FILE=../root5ca_key.pk8
					END	
				END
			END
		END
	END
	// Attributes
	SET
		SEQUENCE
			OID=PKCS9_LOCAL_KEYID
			SET
				OUTPUT_BINARY_FILE=cb004_localkeyid_secondshrouded.der,1			
					OCTETSTRING
						HASH=sha1
							INCLUDE_BINARY_FILE=../root5ca.der
						END
					END
				END
			END
		END 
		SEQUENCE
			OID=PKCS9_FRIENDLY_NAME
			SET
				OUTPUT_BINARY_FILE=cb004_friendlyname_secondshrouded.der,1
					BMPSTRING=symbian
				END
			END
		END	
	END
END




