Search in sources :

Example 1 with LocalFileMetadataBLOBProvider

use of com.webauthn4j.metadata.LocalFileMetadataBLOBProvider in project webauthn4j by webauthn4j.

the class MetadataBLOBBasedTrustAnchorRepositoryTest method createWithBlob.

private MetadataBLOBBasedTrustAnchorRepository createWithBlob(String filePath) {
    try {
        Path blobPath = new File(filePath).toPath();
        Path dstPath = tempDir.resolve("blob.jwt");
        Files.copy(blobPath, dstPath);
        LocalFileMetadataBLOBProvider localFileMetadataBLOBProvider = new LocalFileMetadataBLOBProvider(new ObjectConverter(), dstPath);
        return new MetadataBLOBBasedTrustAnchorRepository(localFileMetadataBLOBProvider);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
Also used : Path(java.nio.file.Path) LocalFileMetadataBLOBProvider(com.webauthn4j.metadata.LocalFileMetadataBLOBProvider) ObjectConverter(com.webauthn4j.converter.util.ObjectConverter) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) File(java.io.File)

Example 2 with LocalFileMetadataBLOBProvider

use of com.webauthn4j.metadata.LocalFileMetadataBLOBProvider in project webauthn4j by webauthn4j.

the class MetadataBLOBTest method getMetadataBLOB.

private MetadataBLOB getMetadataBLOB() {
    try {
        Path blobPath = new File("src/test/resources/integration/component/blob.jwt").toPath();
        Path dstPath = tempDir.resolve("blob.jwt");
        Files.copy(blobPath, dstPath);
        LocalFileMetadataBLOBProvider target = new LocalFileMetadataBLOBProvider(new ObjectConverter(), dstPath);
        return target.provide();
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
Also used : Path(java.nio.file.Path) LocalFileMetadataBLOBProvider(com.webauthn4j.metadata.LocalFileMetadataBLOBProvider) ObjectConverter(com.webauthn4j.converter.util.ObjectConverter) UncheckedIOException(java.io.UncheckedIOException) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) File(java.io.File)

Aggregations

ObjectConverter (com.webauthn4j.converter.util.ObjectConverter)2 LocalFileMetadataBLOBProvider (com.webauthn4j.metadata.LocalFileMetadataBLOBProvider)2 File (java.io.File)2 IOException (java.io.IOException)2 UncheckedIOException (java.io.UncheckedIOException)2 Path (java.nio.file.Path)2