Re: getEncoded() method in Key

Jan Luehe (luehe@laguna.eng.sun.com)
Tue, 12 Jan 1999 18:54:17 -0800 (PST)

Gao:

> Why the Key interface contains getEncoded() method, but no getDecoded()
> method? The document said the getEncoded() method is for transmit
> purpose, so when I get the encoded format of the Key, how can I rebuild
> it to the Key object? Waiting for your reply.

You encapsulate the encoding in the appropriate key specification
and pass it to a (provider-based) key factory.

More details (and examples) under


http://java.sun.com/products/jdk/1.2/docs/guide/security/CryptoSpec.html#KeyFact
ory


Jan