Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
SSH Key FingerprintGenerates a fingerprint for an SSH key.
CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @sTmp0 nvarchar(4000) DECLARE @key int EXEC @hr = sp_OACreate 'Chilkat.SshKey', @key OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @success int -- Load an SSH key from an encrypted OpenSSH-formatted private key: EXEC sp_OASetProperty @key, 'Password', 'secret' DECLARE @keyStr nvarchar(4000) -- First load the PEM into a string: EXEC sp_OAMethod @key, 'LoadText', @keyStr OUT, 'privkey_openssh_encrypted.pem' -- Import into the SSH key object: EXEC sp_OAMethod @key, 'FromOpenSshPrivateKey', @success OUT, @keyStr IF @success <> 1 BEGIN EXEC sp_OAGetProperty @key, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 RETURN END -- Generate the fingerprint: DECLARE @fingerprint nvarchar(4000) EXEC sp_OAMethod @key, 'GenFingerprint', @fingerprint OUT PRINT @fingerprint -- A sample fingerpring looks like this: -- ssh-dss 2048 d0:5f:f7:d6:49:60:7b:50:19:f4:41:59:d4:1f:61:7a END GO |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.