File: base.py

package info (click to toggle)
python-pysnmp4 7.1.21-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,564 kB
  • sloc: python: 33,654; makefile: 166; javascript: 4
file content (36 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
# License: https://www.pysnmp.com/pysnmp/license.html
#
from pysnmp.proto import errind, error


class AbstractAuthenticationService:
    """Abstract base class for SNMPv3 authentication services."""

    SERVICE_ID = None

    def hash_passphrase(self, authKey):
        """Hash authentication key."""
        raise error.ProtocolError(errind.noAuthentication)

    def localize_key(self, authKey, snmpEngineID):
        """Localize authentication key."""
        raise error.ProtocolError(errind.noAuthentication)

    @property
    def digest_length(self):
        """Return length of the digest produced by this service."""
        raise error.ProtocolError(errind.noAuthentication)

    # 7.2.4.1
    def authenticate_outgoing_message(self, authKey, wholeMsg):
        """Authenticate outgoing message."""
        raise error.ProtocolError(errind.noAuthentication)

    # 7.2.4.2
    def authenticate_incoming_message(self, authKey, authParameters, wholeMsg):
        """Authenticate incoming message."""
        raise error.ProtocolError(errind.noAuthentication)