anchor.diff:           :append objects)
       (find-objects-final session)))
   
  +(defun template-from-attribute-type-map (attribute-type-map)
  +  (mapcar (lambda (entry)
  +            ;; This CONS here matches attribute-decode CONS.
  +            (cons (first entry)
  +                  (let ((type (second entry)))
  +                    (if (atom type)
  +                        (ecase type
  +                          ((:ulong)       0)
  +                          ((:bool)        nil)
  +                          ((:string)      nil)
  +                          ((:bytes :bytes-noint :big-integer)  nil)
  +                          ((:date)        "0000000000000000"))
  +                        (ecase (first type)
  +                          ((:ulong)       0)
  +                          ((:big-integer) nil)
  +                          ((:array)       nil))))))
  +          attribute-type-map))
  +
   (defun object-get-all-attributes (session object)
     (check-type session    session-handle)
     (check-type object     object-handle)
     (get-attribute-value session object
  -                       (mapcar (lambda (entry)
  -                                 ;; This CONS here matches attribute-decode CONS.
  -                                 (cons (first entry)
  -                                       (let ((type (second entry)))
  -                                         (if (atom type)
  -                                             (ecase type
  -                                               ((:ulong)       0)
  -                                               ((:bool)        nil)
  -                                               ((:string)      nil)
  -                                               ((:bytes :bytes-noint :big-integer)  nil)
  -                                               ((:date)        "0000000000000000"))
  -                                             (ecase (first type)
  -                                               ((:ulong)       0)
  -                                               ((:big-integer) nil)
  -                                               ((:array)       nil))))))
  -                               *attribute-type-map*)))
  +                       (template-from-attribute-type-map *attribute-type-map*)))
  +
  +(defun object-get-attributes (session object attributes)
  +  (check-type session    session-handle)
  +  (check-type object     object-handle)
  +    (get-attribute-value session object
  +                         (template-from-attribute-type-map
  +                          (remove-if-not (lambda (entry)
  +                                           (member (first entry) attributes))
  +                                         *attribute-type-map*))))
   
   ;;; Encryption
   
  
positive.code:   ;; mechanism is either a mechanism-type integer or keyword, or a list (mechanism-type parameter parameter-length)
    (check-type mechanism mechanism)
    (setf (foreign-slot-value fmechanism '(:struct %ck:mechanism) '%ck:mechanism)     (mechanism-type :encode (if (listp mechanism) (first mechanism) mechanism))
          (foreign-slot-value fmechanism '(:struct %ck:mechanism) '%ck:parameter)     (or (when (listp mechanism) (second parameter))  (null-pointer))
          (foreign-slot-value fmechanism '(:struct %ck:mechanism) '%ck:parameter-len) (or (when (listp mechanism) (third  parameter))  0)))
  
  (defmacro define-pkcs11-initializing-function (name low-name c-name &key (keyp t))
    `(defun ,name (session mechanism ,@(when keyp `(key)))
  
negative.code:            "DESTROY-OBJECT" "GET-OBJECT-SIZE" "GET-ATTRIBUTE-VALUE"
             "SET-ATTRIBUTE-VALUE" "FIND-OBJECTS-INIT" "FIND-OBJECTS"
             "FIND-OBJECTS-FINAL" "FIND-ALL-OBJECTS" "OBJECT-GET-ALL-ATTRIBUTES"
             "OBJECT-GET-ATTRIBUTES"
             "SEED-RANDOM" "GENERATE-RANDOM" "LOAD-LIBRARY"
             "CALL-LOGGED-IN" "DO-LOGGED-IN")
  
  