mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-23 05:17:58 +01:00
Add new SOPGPException types related to hardware modules
This commit is contained in:
parent
1d80ff1d8d
commit
d5c011ea4a
1 changed files with 32 additions and 0 deletions
|
@ -305,4 +305,36 @@ abstract class SOPGPException : RuntimeException {
|
||||||
const val EXIT_CODE = 89
|
const val EXIT_CODE = 89
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sop implementation supports some form of hardware-backed secret keys, but could not
|
||||||
|
* identify the hardware device.
|
||||||
|
*/
|
||||||
|
class NoHardwareKeyFound : SOPGPException {
|
||||||
|
constructor() : super()
|
||||||
|
|
||||||
|
constructor(errorMsg: String) : super(errorMsg)
|
||||||
|
|
||||||
|
override fun getExitCode(): Int = EXIT_CODE
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val EXIT_CODE = 97
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sop implementation tried to use a hardware-backed secret key, but the cryptographic
|
||||||
|
* hardware refused the operation for some reason other than a bad PIN or password.
|
||||||
|
*/
|
||||||
|
class HardwareKeyFailure : SOPGPException {
|
||||||
|
constructor() : super()
|
||||||
|
|
||||||
|
constructor(errorMsg: String) : super(errorMsg)
|
||||||
|
|
||||||
|
override fun getExitCode(): Int = EXIT_CODE
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val EXIT_CODE = 101
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue