mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 04:42:06 +01:00
Add MessageInspector.determineEncryptionInfo(String)
This commit is contained in:
parent
abdc5c8fdd
commit
aed06fc832
1 changed files with 13 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
package org.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -69,6 +70,18 @@ public final class MessageInspector {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses parts of the provided OpenPGP message in order to determine which keys were used to encrypt it.
|
||||||
|
*
|
||||||
|
* @param message OpenPGP message
|
||||||
|
* @return encryption info
|
||||||
|
* @throws PGPException
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public static EncryptionInfo determineEncryptionInfoForMessage(String message) throws PGPException, IOException {
|
||||||
|
return determineEncryptionInfoForMessage(new ByteArrayInputStream(message.getBytes("UTF-8")));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses parts of the provided OpenPGP message in order to determine which keys were used to encrypt it.
|
* Parses parts of the provided OpenPGP message in order to determine which keys were used to encrypt it.
|
||||||
* Note: This method does not rewind the passed in Stream, so you might need to take care of that yourselves.
|
* Note: This method does not rewind the passed in Stream, so you might need to take care of that yourselves.
|
||||||
|
|
Loading…
Reference in a new issue