@Test void testLoad_nullKeyFilePath_throwsNullPointerException() throws URISyntaxException, X509SvidException { try { X509Svid.load(Paths.get(toUri(certSingle)), null); fail("should have thrown exception"); } catch (NullPointerException e) { assertEquals("privateKeyFilePath is marked non-null but is null", e.getMessage()); } }
public static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath) throws X509SvidException { final byte[] certsBytes; try { certsBytes = Files.readAllBytes(certsFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read certificate file", e); } final byte[] privateKeyBytes; try { privateKeyBytes = Files.readAllBytes(privateKeyFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read private key file", e); } return createX509Svid(certsBytes, privateKeyBytes, KeyFileFormat.PEM); }
X509Svid { public static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath) throws X509SvidException { final byte[] certsBytes; try { certsBytes = Files.readAllBytes(certsFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read certificate file", e); } final byte[] privateKeyBytes; try { privateKeyBytes = Files.readAllBytes(privateKeyFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read private key file", e); } return createX509Svid(certsBytes, privateKeyBytes, KeyFileFormat.PEM); } }
X509Svid { public static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath) throws X509SvidException { final byte[] certsBytes; try { certsBytes = Files.readAllBytes(certsFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read certificate file", e); } final byte[] privateKeyBytes; try { privateKeyBytes = Files.readAllBytes(privateKeyFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read private key file", e); } return createX509Svid(certsBytes, privateKeyBytes, KeyFileFormat.PEM); } private  X509Svid(
            final SpiffeId spiffeId,
            final List<X509Certificate> chain,
            final PrivateKey privateKey); }
X509Svid { public static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath) throws X509SvidException { final byte[] certsBytes; try { certsBytes = Files.readAllBytes(certsFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read certificate file", e); } final byte[] privateKeyBytes; try { privateKeyBytes = Files.readAllBytes(privateKeyFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read private key file", e); } return createX509Svid(certsBytes, privateKeyBytes, KeyFileFormat.PEM); } private  X509Svid(
            final SpiffeId spiffeId,
            final List<X509Certificate> chain,
            final PrivateKey privateKey); X509Certificate getLeaf(); List<X509Certificate> getChain(); static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath); static X509Svid parse(@NonNull final byte[] certsBytes, @NonNull final byte[] privateKeyBytes); static X509Svid parseRaw(@NonNull final byte[] certsBytes,
                                    @NonNull final byte[] privateKeyBytes); X509Certificate[] getChainArray(); }
X509Svid { public static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath) throws X509SvidException { final byte[] certsBytes; try { certsBytes = Files.readAllBytes(certsFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read certificate file", e); } final byte[] privateKeyBytes; try { privateKeyBytes = Files.readAllBytes(privateKeyFilePath); } catch (IOException e) { throw new X509SvidException("Cannot read private key file", e); } return createX509Svid(certsBytes, privateKeyBytes, KeyFileFormat.PEM); } private  X509Svid(
            final SpiffeId spiffeId,
            final List<X509Certificate> chain,
            final PrivateKey privateKey); X509Certificate getLeaf(); List<X509Certificate> getChain(); static X509Svid load(@NonNull final Path certsFilePath, @NonNull final Path privateKeyFilePath); static X509Svid parse(@NonNull final byte[] certsBytes, @NonNull final byte[] privateKeyBytes); static X509Svid parseRaw(@NonNull final byte[] certsBytes,
                                    @NonNull final byte[] privateKeyBytes); X509Certificate[] getChainArray();  }