i generate tr-31 block with bp tools but when i use import key function to import key in hsm . i get invalid key block version id error .
this is my sample tr-31 format :
TR-31 Header: B0080K0TB00E0000
----------------------------------------
Version Id: B - TDEA Key Derivation Binding Method
Block Length: 0080
Key Usage: K0 - Key Encryption or wrapping
Algorithm: T - Triple DES
Mode of Use: B - Both Encrypt & Decrypt / Wrap & Unwrap
Key Version No.: 00
Exportability: E - Exportable u. a KEK (meeting req. of X9.24 Pt. 1 or 2)
Num. of Opt. blocks: 00
Reserved: 00
Optional Blocks:
TR-31 Encrypted key: FC96EF3648468D6C22755667DBEF8A053D6A7145F3728FB9
TR-31 MAC: 7FB35431A8935C43
----------------------------------------
K1: A3B024F02952D14F
K2: 476049E052A5A285
KBEK: 12802065300D49CAF1B22A561CBADD78
KBAK: EEB74C38D8E36CFD4DF269B857937CF6
KM1: 8DCD51B609C5ED0A
KM2: 1B9AA36C138BDA0F
and this is my hsm command :
[None hex 001 M] : 'Function Code' = [EE0200]
[None hex 001 M] : 'Function Modifier' = [00]
[None hex var M] : 'Key Spec. for KI/KIR' = [02][0001]
[None n 001 M] : 'Key Type' = [05]
[None hex 001 M] : 'Encryption Mode' = [02]
[None hex var M] : 'eKIR/(KIvx(K)|KI(KB))'= [2A][170028B00800B00E0000CD24B1A0A929661BB9A31B50B34843EC2220560D10CB1104AAACD18DAB7078CA]
[None hex 008 O] : 'eKIR/KI(DT)' = []
[None hex var O] : 'KBS' = []