-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parsed attestation and csr info for Android apps (#21648)
* Draft: Add parsed attestation and csr info for Android apps * Restyle Draft: Add parsed attestation and csr info for Android apps (#21649) * Restyled by google-java-format * Restyled by gn Co-authored-by: Restyled.io <[email protected]> * Restyled by google-java-format (#21694) Co-authored-by: Restyled.io <[email protected]> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
Showing
5 changed files
with
235 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/controller/java/src/chip/devicecontroller/AttestationInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package chip.devicecontroller; | ||
|
||
/** Represents information relating to product attestation. */ | ||
public final class AttestationInfo { | ||
|
||
private byte[] challenge; | ||
private byte[] nonce; | ||
private byte[] elements; | ||
private byte[] elementsSignature; | ||
private byte[] dac; | ||
private byte[] pai; | ||
private byte[] certificationDeclaration; | ||
private byte[] firmwareInfo; | ||
|
||
public AttestationInfo( | ||
byte[] challenge, | ||
byte[] nonce, | ||
byte[] elements, | ||
byte[] elementsSignature, | ||
byte[] dac, | ||
byte[] pai, | ||
byte[] certificationDeclaration, | ||
byte[] firmwareInfo) { | ||
this.challenge = challenge; | ||
this.nonce = nonce; | ||
this.elements = elements; | ||
this.elementsSignature = elementsSignature; | ||
this.dac = dac; | ||
this.pai = pai; | ||
this.certificationDeclaration = certificationDeclaration; | ||
this.firmwareInfo = firmwareInfo; | ||
} | ||
|
||
public byte[] getChallenge() { | ||
return challenge; | ||
} | ||
|
||
public byte[] getNonce() { | ||
return nonce; | ||
} | ||
|
||
public byte[] getElements() { | ||
return elements; | ||
} | ||
|
||
public byte[] getElementsSignature() { | ||
return elementsSignature; | ||
} | ||
|
||
public byte[] getDAC() { | ||
return dac; | ||
} | ||
|
||
public byte[] getPAI() { | ||
return pai; | ||
} | ||
|
||
public byte[] getCertificationDeclaration() { | ||
return certificationDeclaration; | ||
} | ||
|
||
public byte[] getFirmwareInfo() { | ||
return firmwareInfo; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/controller/java/src/chip/devicecontroller/CSRInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package chip.devicecontroller; | ||
|
||
/** Represents information relating to NOC CSR. */ | ||
public final class CSRInfo { | ||
|
||
private byte[] nonce; | ||
private byte[] elements; | ||
private byte[] elementsSignature; | ||
private byte[] csr; | ||
|
||
public CSRInfo(byte[] nonce, byte[] elements, byte[] elementsSignature, byte[] csr) { | ||
this.nonce = nonce; | ||
this.elements = elements; | ||
this.elementsSignature = elementsSignature; | ||
this.csr = csr; | ||
} | ||
|
||
public byte[] getNonce() { | ||
return nonce; | ||
} | ||
|
||
public byte[] getElements() { | ||
return elements; | ||
} | ||
|
||
public byte[] getElementsSignature() { | ||
return elementsSignature; | ||
} | ||
|
||
public byte[] getCSR() { | ||
return csr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters