@@ -677,9 +677,16 @@ public FidoMetadataDownloaderBuilder trustHttpsCerts(@NonNull X509Certificate...
677
677
* written to cache in this case.
678
678
*/
679
679
public MetadataBLOB loadCachedBlob ()
680
- throws CertPathValidatorException , InvalidAlgorithmParameterException , Base64UrlException ,
681
- CertificateException , IOException , NoSuchAlgorithmException , SignatureException ,
682
- InvalidKeyException , UnexpectedLegalHeader , DigestException ,
680
+ throws CertPathValidatorException ,
681
+ InvalidAlgorithmParameterException ,
682
+ Base64UrlException ,
683
+ CertificateException ,
684
+ IOException ,
685
+ NoSuchAlgorithmException ,
686
+ SignatureException ,
687
+ InvalidKeyException ,
688
+ UnexpectedLegalHeader ,
689
+ DigestException ,
683
690
FidoMetadataDownloaderException {
684
691
final X509Certificate trustRoot = retrieveTrustRootCert ();
685
692
@@ -773,9 +780,16 @@ public MetadataBLOB loadCachedBlob()
773
780
* written to cache in this case.
774
781
*/
775
782
public MetadataBLOB refreshBlob ()
776
- throws CertPathValidatorException , InvalidAlgorithmParameterException , Base64UrlException ,
777
- CertificateException , IOException , NoSuchAlgorithmException , SignatureException ,
778
- InvalidKeyException , UnexpectedLegalHeader , DigestException ,
783
+ throws CertPathValidatorException ,
784
+ InvalidAlgorithmParameterException ,
785
+ Base64UrlException ,
786
+ CertificateException ,
787
+ IOException ,
788
+ NoSuchAlgorithmException ,
789
+ SignatureException ,
790
+ InvalidKeyException ,
791
+ UnexpectedLegalHeader ,
792
+ DigestException ,
779
793
FidoMetadataDownloaderException {
780
794
final X509Certificate trustRoot = retrieveTrustRootCert ();
781
795
@@ -797,9 +811,16 @@ public MetadataBLOB refreshBlob()
797
811
798
812
private Optional <MetadataBLOB > refreshBlobInternal (
799
813
@ NonNull X509Certificate trustRoot , @ NonNull Optional <MetadataBLOB > cached )
800
- throws CertPathValidatorException , InvalidAlgorithmParameterException , Base64UrlException ,
801
- CertificateException , IOException , NoSuchAlgorithmException , SignatureException ,
802
- InvalidKeyException , UnexpectedLegalHeader , FidoMetadataDownloaderException {
814
+ throws CertPathValidatorException ,
815
+ InvalidAlgorithmParameterException ,
816
+ Base64UrlException ,
817
+ CertificateException ,
818
+ IOException ,
819
+ NoSuchAlgorithmException ,
820
+ SignatureException ,
821
+ InvalidKeyException ,
822
+ UnexpectedLegalHeader ,
823
+ FidoMetadataDownloaderException {
803
824
804
825
try {
805
826
log .debug ("Attempting to download new BLOB..." );
@@ -928,9 +949,15 @@ private X509Certificate retrieveTrustRootCert()
928
949
* signature.
929
950
*/
930
951
private Optional <MetadataBLOB > loadExplicitBlobOnly (X509Certificate trustRootCertificate )
931
- throws Base64UrlException , CertPathValidatorException , CertificateException , IOException ,
932
- InvalidAlgorithmParameterException , InvalidKeyException , NoSuchAlgorithmException ,
933
- SignatureException , FidoMetadataDownloaderException {
952
+ throws Base64UrlException ,
953
+ CertPathValidatorException ,
954
+ CertificateException ,
955
+ IOException ,
956
+ InvalidAlgorithmParameterException ,
957
+ InvalidKeyException ,
958
+ NoSuchAlgorithmException ,
959
+ SignatureException ,
960
+ FidoMetadataDownloaderException {
934
961
if (blobJwt != null ) {
935
962
return Optional .of (
936
963
parseAndVerifyBlob (
@@ -1008,9 +1035,15 @@ private ByteArray download(URL url) throws IOException {
1008
1035
}
1009
1036
1010
1037
private MetadataBLOB parseAndVerifyBlob (ByteArray jwt , X509Certificate trustRootCertificate )
1011
- throws CertPathValidatorException , InvalidAlgorithmParameterException , CertificateException ,
1012
- IOException , NoSuchAlgorithmException , SignatureException , InvalidKeyException ,
1013
- Base64UrlException , FidoMetadataDownloaderException {
1038
+ throws CertPathValidatorException ,
1039
+ InvalidAlgorithmParameterException ,
1040
+ CertificateException ,
1041
+ IOException ,
1042
+ NoSuchAlgorithmException ,
1043
+ SignatureException ,
1044
+ InvalidKeyException ,
1045
+ Base64UrlException ,
1046
+ FidoMetadataDownloaderException {
1014
1047
Scanner s = new Scanner (new ByteArrayInputStream (jwt .getBytes ())).useDelimiter ("\\ ." );
1015
1048
final ByteArray header = ByteArray .fromBase64Url (s .next ());
1016
1049
final ByteArray payload = ByteArray .fromBase64Url (s .next ());
@@ -1023,8 +1056,13 @@ private MetadataBLOB verifyBlob(
1023
1056
ByteArray jwtPayload ,
1024
1057
ByteArray jwtSignature ,
1025
1058
X509Certificate trustRootCertificate )
1026
- throws IOException , CertificateException , NoSuchAlgorithmException , InvalidKeyException ,
1027
- SignatureException , CertPathValidatorException , InvalidAlgorithmParameterException ,
1059
+ throws IOException ,
1060
+ CertificateException ,
1061
+ NoSuchAlgorithmException ,
1062
+ InvalidKeyException ,
1063
+ SignatureException ,
1064
+ CertPathValidatorException ,
1065
+ InvalidAlgorithmParameterException ,
1028
1066
FidoMetadataDownloaderException {
1029
1067
final ObjectMapper headerJsonMapper =
1030
1068
com .yubico .internal .util .JacksonCodecs .json ()
0 commit comments