2017-11-09 17:51:58 +01:00
|
|
|
import { exists } from '../misc'
|
|
|
|
import { isActivityPubUrlValid } from './misc'
|
|
|
|
|
|
|
|
function isSignatureTypeValid (signatureType: string) {
|
2017-12-18 11:53:04 +01:00
|
|
|
return exists(signatureType) && signatureType === 'RsaSignature2017'
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function isSignatureCreatorValid (signatureCreator: string) {
|
|
|
|
return exists(signatureCreator) && isActivityPubUrlValid(signatureCreator)
|
|
|
|
}
|
|
|
|
|
|
|
|
function isSignatureValueValid (signatureValue: string) {
|
|
|
|
return exists(signatureValue) && signatureValue.length > 0
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
isSignatureTypeValid,
|
|
|
|
isSignatureCreatorValid,
|
|
|
|
isSignatureValueValid
|
|
|
|
}
|