0

私は PEMReader を使用していますが、このコードは機能しません。

protected static KeyPair doReadKeyPair(InputStream is) throws Exception {
    PemReader r = new PemReader(new InputStreamReader(is));
    return (KeyPair) r.readObject();
}

エラー:

This method readObject is undefined forfor the type PemReader.

しかし、多くの Web サイトでこの解決策を見たのに、なぜ私ではなく、それらの Web サイトで機能するのでしょうか?

4

1 に答える 1

3

あなたは何をしようとしているのですか?PEMReaderのjavadocには、非推奨であり、PEMParserを使用する必要があると記載されています。

http://www.bouncycastle.org/docs/pkixdocs1.4/org/bouncycastle/openssl/PEMReader.html

于 2013-03-18T09:53:54.167 に答える