Get credential from the Keytab by principal.
(self, principal, etype=None)
| 837 | ) |
| 838 | |
| 839 | def get_cred(self, principal, etype=None): |
| 840 | """ |
| 841 | Get credential from the Keytab by principal. |
| 842 | """ |
| 843 | for entry in self.keytab.entries: |
| 844 | if entry.getPrincipal() == principal: |
| 845 | if etype is not None and etype != entry.key.keytype: |
| 846 | continue |
| 847 | return entry.key.toKey() |
| 848 | raise ValueError( |
| 849 | "Principal not found in keytab ! " |
| 850 | "Note principals are case sensitive, as on ktpass.exe" |
| 851 | ) |
| 852 | |
| 853 | def ssp(self, i, **kwargs): |
| 854 | """ |
no test coverage detected