signature.ts 641 B

12345678910111213141516171819202122
  1. import { exists } from '../misc'
  2. import { isActivityPubUrlValid } from './misc'
  3. function isSignatureTypeValid (signatureType: string) {
  4. return exists(signatureType) && signatureType === 'RsaSignature2017'
  5. }
  6. function isSignatureCreatorValid (signatureCreator: string) {
  7. return exists(signatureCreator) && isActivityPubUrlValid(signatureCreator)
  8. }
  9. function isSignatureValueValid (signatureValue: string) {
  10. return exists(signatureValue) && signatureValue.length > 0
  11. }
  12. // ---------------------------------------------------------------------------
  13. export {
  14. isSignatureTypeValid,
  15. isSignatureCreatorValid,
  16. isSignatureValueValid
  17. }