Adds a new credential into SecurityCenter.  As credentials can be of
        multiple types, we have different options to specify for each type of
        credential.

        **Global Options (Required)**

        :param name: Unique name to be associated to this credential
        :param cred_type: The type of credential.  Valid values are:
                          'ssh', 'windows', 'snmp', or 'kerberos'
        :type name: string
        :type cred_type: string

        **Windows Credential Options**

        :param username: Account Name
        :param password: Account Password
        :param domain: [Optional] Account Member Domain
        :type username: string
        :type password: string
        :type domain: string

        **Unix/SSH Credential Options**

        SSH Credentials cover a multitude of different types of hosts.
        Everything from Linux/Unix boxes to networking gear like Cisco IOS
        devices.  As a result of this, there are a lot of available options in
        order to cover as many possible scenarios as possible.  A few examples:

        Simple Username/Password:

        >>> sc.credential_add('Example Linux Root', 'ssh',
                username='root', password='r00tp@ssw0rd')

        Utilizing Sudo:

        >>> sc.credential_add('Example Linux Sudo', 'ssh',
                username='user', password='p@ssw0rd',
                privilegeEscalation='sudo',
                escalationPassword='p@ssw0rd')

        SSH Keys (By Filename):

        >>> sc.credential_add('Example Linux Keys', 'ssh',
                username='root',
                privateKey='/path/to/id_rsa',
                publicKey='/path/to/id_rsa.pub',
                passphrase='somthing' # Only use this if needed
            )

        SSH Keys (Using File Objects):

        >>> pubkey = open('/path/to/id_rsa.pub', 'rb')
        >>> privkey = open('/path/to/id_rsa', 'rb')
        >>> sc.credential_add('Example Linux Keys 2', 'ssh',
                username='root',
                privateKey=privkey,
                publicKey=pubkey,
                passphrase='somthing' # Only use this if needed
            )

        :param username: Account Name
        :param password: Account Password
        :param privilegeEscalation: [Optional] The type of privilege escalation
                                required for this account.  The default is None.
                                Valid options are: 'su', 'su+sudo', 'dzdo',
                                'pbrun', 'Cisco \'enable\'', or 'none'.
        :param escalationUsername: [Optional] The username to escalate to.  Only
                                   used for su+sudo escalation.
        :param escalationPassword: [Optional] The password used for escalation.
        :param publicKey: [Optional] The SSH public RSA/DSA key used for
                          authentication.
        :param privateKey: [Optional] The SSH private RSA/DSA key used for
                           authentication.
        :param passphrase: [Optional] The passphrase needed for the RSA/DSA
                           keypair.
        :type username: string
        :type password: string
        :type privilegeEscalation: string
        :type escalationUsername: string
        :type escalationPassword: string
        :type publicKey: string [filename], fileobj
        :type privateKey: string [filename], fileobj
        :type passphrase: string

        **Kerberos Credential Options**

        :param ip: Kerberos Host IP
        :param port: Kerberos Host Port
        :param realm: Kerberos Realm
        :param protocol: Kerberos Protocol
        :type ip: string
        :type port: string
        :type realm: string
        :type protocol: string

        **SNMP Community String**

        :param communityString: The community string to connect with.
        :type communityString: string

def credential_add(self, name, cred_type, **options):
        '''
        Adds a new credential into SecurityCenter.  As credentials can be of
        multiple types, we have different options to specify for each type of
        credential.

        **Global Options (Required)**

        :param name: Unique name to be associated to this credential
        :param cred_type: The type of credential.  Valid values are:
                          'ssh', 'windows', 'snmp', or 'kerberos'
        :type name: string
        :type cred_type: string

        **Windows Credential Options**

        :param username: Account Name
        :param password: Account Password
        :param domain: [Optional] Account Member Domain
        :type username: string
        :type password: string
        :type domain: string

        **Unix/SSH Credential Options**

        SSH Credentials cover a multitude of different types of hosts.
        Everything from Linux/Unix boxes to networking gear like Cisco IOS
        devices.  As a result of this, there are a lot of available options in
        order to cover as many possible scenarios as possible.  A few examples:

        Simple Username/Password:

        >>> sc.credential_add('Example Linux Root', 'ssh',
                username='root', password='r00tp@ssw0rd')

        Utilizing Sudo:

        >>> sc.credential_add('Example Linux Sudo', 'ssh',
                username='user', password='p@ssw0rd',
                privilegeEscalation='sudo',
                escalationPassword='p@ssw0rd')

        SSH Keys (By Filename):

        >>> sc.credential_add('Example Linux Keys', 'ssh',
                username='root',
                privateKey='/path/to/id_rsa',
                publicKey='/path/to/id_rsa.pub',
                passphrase='somthing' # Only use this if needed
            )

        SSH Keys (Using File Objects):

        >>> pubkey = open('/path/to/id_rsa.pub', 'rb')
        >>> privkey = open('/path/to/id_rsa', 'rb')
        >>> sc.credential_add('Example Linux Keys 2', 'ssh',
                username='root',
                privateKey=privkey,
                publicKey=pubkey,
                passphrase='somthing' # Only use this if needed
            )

        :param username: Account Name
        :param password: Account Password
        :param privilegeEscalation: [Optional] The type of privilege escalation
                                required for this account.  The default is None.
                                Valid options are: 'su', 'su+sudo', 'dzdo',
                                'pbrun', 'Cisco \'enable\'', or 'none'.
        :param escalationUsername: [Optional] The username to escalate to.  Only
                                   used for su+sudo escalation.
        :param escalationPassword: [Optional] The password used for escalation.
        :param publicKey: [Optional] The SSH public RSA/DSA key used for
                          authentication.
        :param privateKey: [Optional] The SSH private RSA/DSA key used for
                           authentication.
        :param passphrase: [Optional] The passphrase needed for the RSA/DSA
                           keypair.
        :type username: string
        :type password: string
        :type privilegeEscalation: string
        :type escalationUsername: string
        :type escalationPassword: string
        :type publicKey: string [filename], fileobj
        :type privateKey: string [filename], fileobj
        :type passphrase: string

        **Kerberos Credential Options**

        :param ip: Kerberos Host IP
        :param port: Kerberos Host Port
        :param realm: Kerberos Realm
        :param protocol: Kerberos Protocol
        :type ip: string
        :type port: string
        :type realm: string
        :type protocol: string

        **SNMP Community String**

        :param communityString: The community string to connect with.
        :type communityString: string
        '''

        if 'pirvateKey' in options:
            options['privateKey'] = self._upload(options['privateKey'])['filename']
        if 'publicKey' in options:
            options['publicKey'] = self._upload(options['publicKey'])['filename']

        return self.raw_query("credential", "add", data=options)