Java 类org.bouncycastle.openpgp.PGPMarker 实例源码

项目:desktopclient-java    文件:PGPUtils.java   
public static boolean isEncryptedFile(Path file) {
    try (FileInputStream input = new FileInputStream(file.toFile())) {
        PGPObjectFactory factory = new PGPObjectFactory(input, FP_CALC);
        Object o = factory.nextObject();
        return o instanceof PGPEncryptedDataList || o instanceof PGPMarker;
    // NOTE: exception class is not well defined for non-pgp data
    } catch(IOException | RuntimeException ex) {
        return false;
    }
}