From: Ronald T. <ron...@ia...> - 2009-08-11 12:09:47
|
Hi Simon, You can also set the private part using the TSS_TSPATTRIB_KEYBLOB_PRIVATE_KEY attribute. Of course, any such created TPM key MUST be initialized as "migratable". > But the private part has a few more troubles. Please try to be a bit more specific next time.. ;-) Ronald Simon Mittelberger wrote: > Hello, > > i didn't find a way to import an externally created RSA key into the > TPM. Could you please describe a way how to do so? > > How to load the public part is quite clear: > > KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); > generator.initialize((int)DeviceDefines.DEVICE_KEY_LENGTH); > KeyPair keyPair = generator.generateKeyPair(); > > TcTpmPubkey pubKeyStruct = > TcCrypto.pubJavaToTpmKey((RSAPublicKey)keyPair.getPublic()); > TcIRsaKey tpmmKey = > context_.createRsaKeyObject(TcTssConstants.TSS_KEY_EMPTY_KEY); > > pubKey.setAttribData(TcTssConstants.TSS_TSPATTRIB_KEY_BLOB, > TcTssConstants.TSS_TSPATTRIB_KEYBLOB_PUBLIC_KEY, > pubKeyStruct.getEncoded()); > > But the private part has a few more troubles. > > all the best > Simon > -- Dipl.-Ing. Ronald Tögl phone +43 316/873-5502 Trusted Computing Labs fax +43 316/873-5520 IAIK ron...@ia... Graz University of Technology http://www.iaik.tugraz.at |