/** * @throws IllegalStateException if data already set */ public void readBytes(InputStream in) throws DataFormatException, IOException { if (_publicKey != null || _signingKey != null || _certificate != null) throw new IllegalStateException(); _publicKey = PublicKey.create(in); SigningPublicKey spk = SigningPublicKey.create(in); Certificate cert = Certificate.create(in); if (cert.getCertificateType() == Certificate.CERTIFICATE_TYPE_KEY) { // convert SPK to new SPK and padding KeyCertificate kcert = cert.toKeyCertificate(); _signingKey = spk.toTypedKey(kcert); _padding = spk.getPadding(kcert); _certificate = kcert; } else { _signingKey = spk; _certificate = cert; } }
sk = sk.toTypedKey(kcert); c = kcert; } else {