SQL Server Stored Procedure Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

SQL Server
Stored Procedure Examples

Quick Start
Encryption
File Access
IMAP
POP3
SMTP
Email Object
FTP
HTML-to-XML
HTTP
MHT
MIME
RSA
Diffie-Hellman
DSA
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
String
Tar
Upload
XML
XMP
Zip

Bz2
CSV
FileAccess
Byte Array
RSS
Atom
Self-Extractor

SSH Key Fingerprint

Generates a fingerprint for an SSH key.

Download Chilkat SSH / SFTP ActiveX

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.