Skip to content

Commit

Permalink
Added signature validation error checker (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrsarapulovgl authored May 21, 2021
1 parent 1c94896 commit 0b84314
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ data class VerificationResult(
return base45Decoded && zlibDecoded && coseVerified && cborDecoded && isSchemaValid && isTestValid
}

/**
* Checks if all the checks but signature validation passed.
* Ultimately value {@code true} returned by the method
* would mean that signature validation has been checked. And it failed.
*/
fun isSignatureInvalid(): Boolean {
val isTestValid = testVerification?.isDetected ?: true
return (base45Decoded && zlibDecoded && cborDecoded && isSchemaValid && isTestValid) && !coseVerified
}

override fun toString(): String {
return "VerificationResult: \n" +
"base45Decoded: $base45Decoded \n" +
Expand Down

0 comments on commit 0b84314

Please sign in to comment.