Initial commit
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
import { makeDERSequence, makeDEROctetString } from './derUtil.js';
|
||||
var DigestInfo = /** @class */ (function () {
|
||||
function DigestInfo(digestAlgorithm, digest) {
|
||||
this.digestAlgorithm = digestAlgorithm;
|
||||
this.digest = digest;
|
||||
}
|
||||
DigestInfo.prototype.toDER = function () {
|
||||
var digest = this.digest;
|
||||
var digestArray;
|
||||
if ('buffer' in digest) {
|
||||
digestArray = new Uint8Array(digest.buffer, digest.byteOffset, digest.byteLength);
|
||||
}
|
||||
else {
|
||||
digestArray = new Uint8Array(digest);
|
||||
}
|
||||
var derData = this.digestAlgorithm
|
||||
.toDER()
|
||||
.concat(makeDEROctetString(digestArray));
|
||||
return makeDERSequence(derData);
|
||||
};
|
||||
return DigestInfo;
|
||||
}());
|
||||
export default DigestInfo;
|
||||
Reference in New Issue
Block a user