Example usage for java.net JarURLConnection getCertificates

List of usage examples for java.net JarURLConnection getCertificates

Introduction

In this page you can find the example usage for java.net JarURLConnection getCertificates.

Prototype

public java.security.cert.Certificate[] getCertificates() throws IOException 

Source Link

Document

Returns the Certificate objects for this connection if the URL for it points to a JAR file entry, null otherwise.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    URL url = new URL("jar:file:/c://my.jar!/");
    JarURLConnection conn = (JarURLConnection) url.openConnection();

    Attributes attrs = conn.getAttributes();
    Certificate[] certs = conn.getCertificates();

}