@@ -75,7 +75,7 @@ final class TpmAttestationStatementVerifier
75
75
* https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
76
76
*/
77
77
static final class Attributes {
78
- public static final int SIGN_ENCRYPT = 1 << 18 ;
78
+ static final int SIGN_ENCRYPT = 1 << 18 ;
79
79
80
80
private static final int SHALL_BE_ZERO =
81
81
(1 << 0 ) // 0 Reserved
@@ -360,8 +360,8 @@ private void verifyPublicKeysMatch(AttestationObject attestationObject, TpmtPubl
360
360
}
361
361
362
362
static final class TpmAlgAsym {
363
- public static final int RSA = 0x0001 ;
364
- public static final int ECC = 0x0023 ;
363
+ static final int RSA = 0x0001 ;
364
+ static final int ECC = 0x0023 ;
365
365
}
366
366
367
367
private interface Parameters {}
@@ -376,7 +376,7 @@ private static class TpmtPublic {
376
376
Unique unique ;
377
377
ByteArray rawBytes ;
378
378
379
- public static TpmtPublic parse (byte [] pubArea ) throws IOException {
379
+ private static TpmtPublic parse (byte [] pubArea ) throws IOException {
380
380
try (ByteInputStream reader = new ByteInputStream (pubArea )) {
381
381
final int signAlg = reader .readUnsignedShort ();
382
382
final int nameAlg = reader .readUnsignedShort ();
@@ -433,7 +433,7 @@ public static TpmtPublic parse(byte[] pubArea) throws IOException {
433
433
* nvPublicArea contents of the TPMS_NV_PUBLIC associated with handle
434
434
* </pre>
435
435
*/
436
- public ByteArray name () {
436
+ private ByteArray name () {
437
437
final ByteArray hash ;
438
438
switch (this .nameAlg ) {
439
439
case TpmAlgHash .SHA1 :
@@ -464,13 +464,13 @@ public ByteArray name() {
464
464
}
465
465
466
466
static class TpmAlgHash {
467
- public static final int SHA1 = 0x0004 ;
468
- public static final int SHA256 = 0x000B ;
469
- public static final int SHA384 = 0x000C ;
470
- public static final int SHA512 = 0x000D ;
467
+ static final int SHA1 = 0x0004 ;
468
+ static final int SHA256 = 0x000B ;
469
+ static final int SHA384 = 0x000C ;
470
+ static final int SHA512 = 0x000D ;
471
471
}
472
472
473
- public void verifyX5cRequirements (X509Certificate cert , ByteArray aaguid )
473
+ private void verifyX5cRequirements (X509Certificate cert , ByteArray aaguid )
474
474
throws CertificateParsingException {
475
475
ExceptionUtil .assure (
476
476
cert .getVersion () == 3 ,
@@ -529,7 +529,7 @@ public void verifyX5cRequirements(X509Certificate cert, ByteArray aaguid)
529
529
}
530
530
531
531
static final class TpmRsaScheme {
532
- public static final int RSASSA = 0x0014 ;
532
+ static final int RSASSA = 0x0014 ;
533
533
}
534
534
535
535
/**
@@ -542,7 +542,7 @@ private static class TpmsRsaParms implements Parameters {
542
542
543
543
long exponent ;
544
544
545
- public static TpmsRsaParms parse (ByteInputStream reader ) throws IOException {
545
+ private static TpmsRsaParms parse (ByteInputStream reader ) throws IOException {
546
546
final int symmetric = reader .readUnsignedShort ();
547
547
ExceptionUtil .assure (
548
548
symmetric == TPM_ALG_NULL ,
@@ -573,7 +573,7 @@ public static TpmsRsaParms parse(ByteInputStream reader) throws IOException {
573
573
private static class Tpm2bPublicKeyRsa implements Unique {
574
574
ByteArray bytes ;
575
575
576
- public static Tpm2bPublicKeyRsa parse (ByteInputStream reader ) throws IOException {
576
+ private static Tpm2bPublicKeyRsa parse (ByteInputStream reader ) throws IOException {
577
577
return new Tpm2bPublicKeyRsa (new ByteArray (reader .read (reader .readUnsignedShort ())));
578
578
}
579
579
}
@@ -582,7 +582,7 @@ public static Tpm2bPublicKeyRsa parse(ByteInputStream reader) throws IOException
582
582
private static class TpmsEccParms implements Parameters {
583
583
int curve_id ;
584
584
585
- public static TpmsEccParms parse (ByteInputStream reader ) throws IOException {
585
+ private static TpmsEccParms parse (ByteInputStream reader ) throws IOException {
586
586
final int symmetric = reader .readUnsignedShort ();
587
587
final int scheme = reader .readUnsignedShort ();
588
588
ExceptionUtil .assure (
@@ -614,7 +614,7 @@ private static class TpmsEccPoint implements Unique {
614
614
ByteArray x ;
615
615
ByteArray y ;
616
616
617
- public static TpmsEccPoint parse (ByteInputStream reader ) throws IOException {
617
+ private static TpmsEccPoint parse (ByteInputStream reader ) throws IOException {
618
618
final ByteArray x = new ByteArray (reader .read (reader .readUnsignedShort ()));
619
619
final ByteArray y = new ByteArray (reader .read (reader .readUnsignedShort ()));
620
620
@@ -630,10 +630,10 @@ public static TpmsEccPoint parse(ByteInputStream reader) throws IOException {
630
630
*/
631
631
private static class TpmEccCurve {
632
632
633
- public static final int NONE = 0x0000 ;
634
- public static final int NIST_P256 = 0x0003 ;
635
- public static final int NIST_P384 = 0x0004 ;
636
- public static final int NIST_P521 = 0x0005 ;
633
+ private static final int NONE = 0x0000 ;
634
+ private static final int NIST_P256 = 0x0003 ;
635
+ private static final int NIST_P384 = 0x0004 ;
636
+ private static final int NIST_P521 = 0x0005 ;
637
637
}
638
638
639
639
/**
0 commit comments