Zyre::

Certstore class

A certificate store for Zyre curve authentication.

Refs: - api.zeromq.org/czmq4-0:zcertstore

Public Instance Methods

insert( certificate )

Insert certificate (a Zyre::Cert) into certificate store in memory. Note that this does not save the certificate to disk. To do that, use Zyre::Cert#save directly on the certificate.

static VALUE
rzyre_certstore_insert( VALUE self, VALUE cert )
{
        zcertstore_t *ptr = rzyre_get_certstore( self );
        zcert_t *zcert = rzyre_get_cert( cert );
        zcert_t *zcert_owned = zcert_dup( zcert );

        assert( zcert_owned );
        zcertstore_insert( ptr, &zcert_owned );

        return Qtrue;
}
lookup( public_key )

Look up certificate by public key, returns Zyre::Cert object if found, else returns nil. The public_key should be a String in Z85 text format.

static VALUE
rzyre_certstore_lookup( VALUE self, VALUE public_key )
{
        zcertstore_t *ptr = rzyre_get_certstore( self );
        const char *key_txt = StringValueCStr( public_key );
        zcert_t *cert = zcertstore_lookup( ptr, key_txt );

        if ( cert ) {
                VALUE zyre_cert = rzyre_wrap_cert( cert );
                return zyre_cert;
        }

        return Qnil;
}
print

Print list of certificates in store to logging facility.