C++系列-STL容器中的map容器

news/2024/9/16 16:47:09/ 标签: c++, java, 开发语言

STL容器中的map容器

  • map的基本概念
  • map的特点
  • map的构造
  • map的赋值
  • map的插入
  • map的删除
  • map的大小
  • map的交换查找,统计
  • map的排序


无题二首·其一 李商隐
昨夜星辰昨夜风,画楼西畔桂堂东。
身无彩凤双飞翼,心有灵犀一点通。
隔座送钩春酒暖,分曹射覆蜡灯红。
嗟余听鼓应官去,走马兰台类转蓬。


map的基本概念

  • map是一种关联容器,也被称为字典,底层结构是二叉树。
  • 它以键值对key,value的形式存储元素。其中key是唯一的,用于快速查找对应的value。
  • 如果尝试插入具有相同key的元素,旧的值将被新的覆盖。
  • map提供双向迭代器,可以遍历容器中的所有键值对。
  • 迭代器指向的是pair类型的对象,first成员属性是key,second成员属性是value
  • multimap的key值是可以重复的,其它的与map类似。

map的特点

  • 有序性,map中的元素是按照key的特定顺序存储的,默认情况下是key的升序排列,可以按照顺序遍历map中的元素,并可以进行范围查询等操作。
  • map中的key有唯一性,multimap则无。
  • 高效的查找和插入。
  • map以键值对的方式存储元素,方便将相关的数据关联在一起。
  • 可以通过自定义的比较函数来改变key的排序规则。

map的构造

构造函数描述
map<type1, type2> mp1默认构造函数
map<type1, type2> mp2(mp1)拷贝构造
map<type1, type2> mp2{{},{}…}初始化列表构造
map<type1, type2> mp4(迭代器1, 迭代器2范围构造
map<type1, type2> mp5(move(mp1)直接移动,并不拷贝
code:
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;template<typename T1, typename T2>
void print_map(const map<T1, T2>& mp)
{for (auto i_mp: mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}
void test01()
{// 默认构造map<string, int> mp1;pair<string, int> pr1 ("Lily", 9);pair<string, int> pr2 ("Lucy", 10);mp1.insert(pr1);mp1.insert(pr2);cout << "---------- mp1, mp1.size() ---------- " << mp1.size() << endl;print_map(mp1);cout << "value of key Lily: " << mp1["Lily"] << endl;	// 访问元素value的方式// 拷贝构造map<string, int> mp2(mp1);cout << "---------- map<string, int> mp2(mp1), mp2 ---------- " << mp2.size() << endl;print_map(mp2);// 初始化列表构造map<string, int> mp3{ {"Hanmeimei", 9}, { "Poly", 2 } }) cout << "---------- map<string, int> mp3({{},{},...}), mp3 ---------- " << mp3.size() << endl;print_map(mp3);// 范围构造vector<pair<string, int>> vec1 = { {"张三", 5}, {"李四", 6}, {"王五", 7} };map<string, int> mp4(vec1.begin(), vec1.begin() + 2);cout << "---------- map<string, int> mp4(vec1.begin(), vec1.begin() + 2), mp4 ---------- " << mp4.size() << endl;print_map(mp4);// 移动构造,move括号中的元素空间会直接移动cout << "---------- 移动构造前 ----------" << endl;cout << "mp3.size(): " << mp3.size() << endl;map<string, int> mp5(move(mp3));cout << "---------- 移动构造后 ----------" << endl;cout << "---------- map<string, int> mp5(move(mp3)) ---------- " << mp5.size() << endl;print_map(mp5);cout << "mp3.size(): " << mp3.size() << endl;print_map(mp3);
}
int main()
{test01();system("pause");return 0;
}result:
---------- mp1, mp1.size() ---------- 2
first: Lily, second: 9
first: Lucy, second: 10
value of key Lily: 9
---------- map<string, int> mp2(mp1), mp2 ---------- 2
first: Lily, second: 9
first: Lucy, second: 10
---------- map<string, int> mp3({{},{},...}), mp3 ---------- 2
first: Hanmeimei, second: 9
first: Poly, second: 2
---------- map<string, int> mp4(vec1.begin(), vec1.begin() + 2), mp4 ---------- 2
first: 李四, second: 6
first: 张三, second: 5
---------- 移动构造前 ----------
mp3.size(): 2
---------- 移动构造后 ----------
---------- map<string, int> mp5(move(mp3)) ---------- 2
first: Hanmeimei, second: 9
first: Poly, second: 2
mp3.size(): 0

map的赋值

  • 使用=重载
code:
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;template<typename T1, typename T2>
void print_map(const map<T1, T2>& mp)
{for (auto i_mp : mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}
void test01()
{// = 赋值map<string, int> mp1{{"Lily", 9}, { "Lucy", 10 }};cout << "---------- mp1, mp1.size() ---------- " << mp1.size() << endl;print_map(mp1);map<string, int> mp2 = mp1;cout << "---------- map<string, int> mp2 = mp1, mp2 ---------- " << mp2.size() << endl;print_map(mp2);
}
int main()
{test01();system("pause");return 0;
}result:
---------- mp1, mp1.size() ---------- 2
first: Lily, second: 9
first: Lucy, second: 10
---------- map<string, int> mp2 = mp1, mp2 ---------- 2
first: Lily, second: 9
first: Lucy, second: 10

map的插入

构造函数描述
pair<iterator, bool> insert(pair<type ,type2>(key, value))insert插入pair,返回值是pair,第一个元素时迭代器,迭代器所指值的第一个元素是key,第二个是value,pair中的second元素bool类型表示是否插入成功
pair<iterator, bool> insert(make_pair(key, value))insert插入pair,pair由make_pair产生,返回值同上
pair<iterator, bool> insert(map<type1, type2>::value_type(key, value))使用type_value函数产生pair对象,返回值同上
mapped_type& mp1[value]=value[]插入法, 如果插错了,比如key写错了,会自动创建一个对应这个key的元素,value设置为0,建议少用,但[]通过key访问value很方便
void insert({ val1, val2, … })一次向 map 容器中插入多个键值对
void insert (InputIterator first, InputIterator last)插入某map容器中的指定区域
iterator insert (const_iterator position, const value_type& val)会按照key自动排序,不按照position的指示
code:
#include <iostream>
#include <map>
using namespace std;template<typename T1, typename T2>
void print_map(const map<T1, T2>& mp)
{for (auto i_mp : mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}
void test01()
{// pair<iterator, bool> insert(pair<type, type2>(key, value)map<string, int> mp1{{"Lily", 9}, { "Lucy", 10 }};//pair<map<string, int>::iterator, bool> pr1 = mp1.insert(pair<string, int>("Jim", 10));auto pr1 = mp1.insert(pair<string, int>("Jim", 10));	// 可以用auto,更简单cout << "----- pr1.first->first: " << pr1.first->first << ", pr1.first->second: " << pr1.first->second << ", pr1.second: " << pr1.second << endl;// pair<iterator, bool> insert(make_pair(key, value)auto pr2 = mp1.insert(make_pair("Poly", 2));cout << "----- pr2.first->first: " << pr2.first->first << ", pr2.first->second: " << pr2.first->second << ", pr2.second: " << pr2.second << endl;// iterator insert(map<type1, type2>::value_type(key, value))auto pr3 = mp1.insert(map<string, int>::value_type("Hanmeimei", 11));		// value_type返回是pair对象cout << "----- pr3.first->first: " << pr3.first->first << ", pr3.first->second: " << pr3.first->second << ", pr3.second: " << pr3.second << endl;// mapped_type& mp1[key]= valuemp1["MissGao"] = 33;// void insert({ val1, val2, ... });mp1.insert({ { "张三", 12 }, { "李四", 11 }, { "王五", 11 } });print_map(mp1);
}
int main()
{test01();system("pause");return 0;
}result:
----- pr1.first->first: Jim, pr1.first->second: 10, pr1.second: 1
----- pr2.first->first: Poly, pr2.first->second: 2, pr2.second: 1
----- pr3.first->first: Hanmeimei, pr3.first->second: 11, pr3.second: 1
first: Hanmeimei, second: 11
first: Jim, second: 10
first: Lily, second: 9
first: Lucy, second: 10
first: MissGao, second: 33
first: Poly, second: 2
first: 李四, second: 11
first: 王五, second: 11
first: 张三, second: 12

code:
#include <iostream>
#include <map>
using namespace std;template<typename T1, typename T2>
void print_map(const map<T1, T2>& mp)
{for (auto i_mp : mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}
void test01()
{cout << "---------- mp1 ----------" << endl;map<string, int> mp1{{"Lily", 9}, { "Lucy", 10 }};mp1.insert({ { "张三", 12 }, { "李四", 11 }, { "王五", 11 } });print_map(mp1);cout << "---------- mp2 ----------" << endl;map<string, int> mp2;auto it = mp1.find("王五");// void insert (InputIterator first, InputIterator last) //插入某map容器中的指定区域mp2.insert(mp1.begin(), it);print_map(mp2);cout << "---------- mp3 ----------" << endl;map<string, int> mp3{{"吴彦祖", 48}, { "金城武", 46 }};// iterator insert (const_iterator position, const value_type& val), 会按照key自动排序,不按照position的指示map<string, int>::iterator iter1 = mp3.insert(mp3.find("吴彦祖"), {"古天乐", 18});print_map(mp3);cout << "\nreturn value check" << endl;cout << "first: " << iter1->first << ", second: " << iter1->second << endl;
}
int main()
{test01();system("pause");return 0;
}result:
---------- mp1 ----------
first: Lily, second: 9
first: Lucy, second: 10
first: 李四, second: 11
first: 王五, second: 11
first: 张三, second: 12
---------- mp2 ----------
first: Lily, second: 9
first: Lucy, second: 10
first: 李四, second: 11
---------- mp3 ----------
first: 古天乐, second: 18
first: 金城武, second: 46
first: 吴彦祖, second: 48return value check
first: 古天乐, second: 18

map的删除

构造函数描述
iterator erase(const_iterator position)有的版本是返回删除的元素的迭代器,有的是返回其下一个
size_type erase (const key_type& k)返回删除了几个元素,map只能为0和1,multimap可以有多个
iterator erase(const_iterator first, const_iterator last)有的版本是返回删除的元素的迭代器,有的是返回其下一个
code:
#include <iostream>
#include <map>
using namespace std;template<typename T1, typename T2>
void print_map(const map<T1, T2>& mp)
{for (auto i_mp : mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}
void test01()
{cout << "---------- mp1 ----------" << endl;map<string, int> mp1{{"Lily", 9}, { "Lucy", 10 }};mp1.insert({ { "张三", 12 }, { "李四", 11 }, { "王五", 11 } });print_map(mp1);//iterator erase(const_iterator position); 有的版本是返回删除的元素的迭代器,有的是返回其下一个map<string, int>::iterator it = mp1.erase(mp1.find("张三"));cout << "it->first: " << (--it)->first << endl;// size_type erase (const key_type& k)		返回删除了几个元素,map只能为0和1,multimap可以有多个int st1 = mp1.erase("李四");cout << "int st1 = mp1.erase(key)" << endl;cout << "---------- mp1 ----------" << endl;print_map(mp1);// iterator erase(const_iterator first, const_iterator last)it = mp1.erase(mp1.begin(), --mp1.end());cout << endl;cout << "mp1.erase(mp1.begin(), --mp1.end())" << endl;		//返回指向下一个元素的迭代器print_map(mp1);cout << "it->first: " << it->first << endl;mp1.clear();cout << "mp1.clear(), mp1.size(): " << mp1.size() << endl;print_map(mp1);
}
int main()
{test01();system("pause");return 0;
}result:
---------- mp1 ----------
first: Lily, second: 9
first: Lucy, second: 10
first: 李四, second: 11
first: 王五, second: 11
first: 张三, second: 12
it->first: 王五
int st1 = mp1.erase(key)
---------- mp1 ----------
first: Lily, second: 9
first: Lucy, second: 10
first: 王五, second: 11mp1.erase(mp1.begin(), --mp1.end())
first: 王五, second: 11
it->first: 王五
mp1.clear(), mp1.size(): 0

map的大小

构造函数描述
size()返回map容器的大小
empty()返回map容器是否为空

map的交换查找,统计

|:--------😐:-------------|
|find() |如果查找到,返回查找到的迭代器,否则返回end() |
|count()|map的统计count(),map返回0或者1 |
|sort()|map的排序 |

code:
#include <iostream>
#include <map>
using namespace std;template<typename T1, typename T2>
void print_map(const map<T1, T2>& mp)
{for (auto i_mp : mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}
void test01()
{map<string, int> mp1{{"Lily", 9}, { "Lucy", 10 }};mp1.insert({ { "张三", 12 }, { "李四", 11 }, { "王五", 11 } });cout << "---------- mp1.size() ----------, " << mp1.size() << endl;print_map(mp1);// map的交换map<string, int> mp2;mp2["1"] = 111;mp2["2"] = 222;mp2["3"] = 333;cout << "---------- swap前----------, " << endl;print_map(mp1);print_map(mp2);cout << "---------- swap后----------, " << endl;mp1.swap(mp2);print_map(mp1);print_map(mp2);// map的查找iterator find(const key_type& _Keyval),如果查找到,返回查找到的迭代器,否则返回end()map<string, int>::iterator it = mp2.find("2");cout << "---------- mp2.find(\"2\")----------, " << endl;cout << "it->first: " << (--it)->first << endl;// size_type count(const key_type& _Keyval) map的统计count(),map返回0或者1int mp_count = mp1.count("3");cout << "---------- mp1.count(\"1\")----------, " << endl;cout << "mp_count: " << mp_count << endl;
}
int main()
{test01();system("pause");return 0;
}result:
---------- mp1.size() ----------, 5
first: Lily, second: 9
first: Lucy, second: 10
first: 李四, second: 11
first: 王五, second: 11
first: 张三, second: 12
---------- swap前----------,
first: Lily, second: 9
first: Lucy, second: 10
first: 李四, second: 11
first: 王五, second: 11
first: 张三, second: 12
first: 1, second: 111
first: 2, second: 222
first: 3, second: 333
---------- swap后----------,
first: 1, second: 111
first: 2, second: 222
first: 3, second: 333
first: Lily, second: 9
first: Lucy, second: 10
first: 李四, second: 11
first: 王五, second: 11
first: 张三, second: 12
---------- mp2.find("2")----------,
it->first: 张三
---------- mp1.count("1")----------,
mp_count: 1

map的排序

  • map的排序都是按照key来排序的,在创建map容器时就要指定好排序方式。
  • 对于普通数据类型会自动按照升序,如果要改变,可以自己写排序方式。
  • 自定义类型在创建时需要指定好排序规则,不然系统不知道怎么给排序,无法创建
code:
#include <iostream>
#include <map>
using namespace std;class Person
{friend class MyComparePerson;template<typename T1, typename T2, typename T3>friend void print_map(const map<T1, T2, T3>& mp);template<typename Person, typename T2>friend void print_map(const map<Person, T2, MyComparePerson>& mp);public:Person(string name, int age){m_name = name;m_age = age;}
private:string m_name;int m_age;
};
template<class T>
class MyCompare
{
public:bool operator()(const T &v1, const T &v2) const		// 这是需要用const限定,不然报错{return v1 > v2;}
};class MyComparePerson
{
public:bool operator()(const Person &p1, const Person &p2) const		// 这是需要用const限定,不然报错{return p1.m_age > p2.m_age;}
};template<typename T1, typename T2>
void print_map(const map<T1, T2, MyCompare<string>>& mp)
{for (auto i_mp : mp){cout << "first: " << i_mp.first << ", second: " << i_mp.second << endl;}
}template<typename Person, typename T2>
void print_map(const map<Person, T2, MyComparePerson>& mp)
{for (auto i_mp : mp){cout << "key.m_name: " << i_mp.first.m_name << ", key.m_age: " << i_mp.first.m_age << ", value: " << i_mp.second << endl;}
}void test01()
{// 普通数据类型会自动按照升序,如果要改变,可以自己写排序方式// 在创建时就要指定排序方式map<string, int, MyCompare<string>> mp2{ {"1", 20}, { "2", 30 }, { "3", 60 } };print_map(mp2);
}void test02()
{// 自定义类型在创建时需要指定好排序规则,不然系统不知道怎么给排序,无法创建// 在创建时就要指定排序方式//map<Person, int, MyComparePerson> mp1;map<Person, int, MyComparePerson> mp1;Person p1("lily", 12);Person p2("Lucy", 15);Person p3("Jim", 17);mp1.insert({{p1, 33}, {p2, 22}, {p3, 77} });print_map(mp1);
}int main()
{test01();test02();system("pause");return 0;
}result:
first: 3, second: 60
first: 2, second: 30
first: 1, second: 20
key.m_name: Jim, key.m_age: 17, value: 77
key.m_name: Lucy, key.m_age: 15, value: 22
key.m_name: lily, key.m_age: 12, value: 33

http://www.ppmy.cn/news/1521534.html

相关文章

【机器人工具箱Robotics Toolbox开发笔记(四)】 机器人位姿变换之位姿变换函数

机器人学的位姿变换相关内容,可以采用下列函数来进行计算。 (1)rpy2r() R = rpy2r (roll, pitch, yaw, options)能够根据一组回转角、俯仰角和偏转角求出对应齐次变换矩阵中的旋转矩阵R(3x3),其中3个角度rpy = [R, P, Y]分别对应于关于x、y、z轴的顺序旋转。 R = rpy2r…

Kafka-设计原理

ControllerLeader - PartitionRebalance消息发布机制HW与LEO日志分段 Controller Kafka核心总控制器Controller&#xff1a;在Kafka集群中会有一个或者多个broker&#xff0c;其中有一个broker会被选举为控制器&#xff08;Kafka Controller&#xff09;&#xff0c;它负责管理…

新手教学系列——如何应对业务扩展中的MongoDB升级挑战

在业务发展的早期,MongoDB的单节点配置就能满足大部分需求。然而,随着数据量的增加和业务的不断扩展,单节点已无法应对高并发的读写需求。此时,升级MongoDB成为必要选择,最常见的升级路径是从单节点扩展为副本集,随后再进行分片。本文将结合实际操作,详细讲解如何通过合…

LeetCode 209:长度最小的子数组 ← 滑动窗口

【题目来源】https://leetcode.cn/problems/minimum-size-subarray-sum/description/【题目描述】 给定一个含有 n 个正整数的数组和一个正整数 target。 找出该数组中满足其总和大于等于 target 的长度最小的子数组&#xff0c;并返回其长度。如果不存在符合条件的子数组&…

RK3566/RK3568 Android 11 动态隐藏应用通知

概述 总目录:RK3566/RK3568 Android 11 定制大全 在系统服务中增加动态隐藏APP通知,可以在上层app动态添加需要隐藏通知的APP,支持添加多个APP,支持移除,重启或关机后还能继续生效。 创建全局变量 1.定义全局变量 在frameworks/base/core/java/android/provider/Sett…

全面解读 Spring 和 Spring MVC 常用注解

Spring 是一个功能强大的 Java 框架&#xff0c;用于构建企业级应用程序。Spring MVC 是 Spring 框架的一部分&#xff0c;专注于构建基于 Web 的应用程序。为了有效地使用这些框架&#xff0c;了解常用注解及其应用场景至关重要。 1. 总体总结 Spring 框架和 Spring MVC 提供…

钢铁百科:Q460DR钢板材质、Q460DR钢板性能分析、Q460DR执行标准

Q460DR钢板是一种高性能的低温压力容器用钢板&#xff0c;具有优异的力学性能和广泛的应用范围。以下是对其材质、执行标准、化学成分、力学性能、交货状态、应用范围、常用规格及总结的详细介绍&#xff1a; 一、Q460DR材质 Q460DR钢板的命名中&#xff0c;“Q”代表屈服强度&…

vscode添加到环境变量之快捷使用

将 VSCode (Visual Studio Code) 添加到环境变量 PATH 中&#xff0c;可以为你带来以下便利&#xff1a; 1. 在命令行中全局调用 code 命令 功能: 当你将 VSCode 添加到 PATH 环境变量后&#xff0c;你可以在命令行&#xff08;如 CMD、PowerShell、Bash 等&#xff09;中直接…

X管家listUploadIntelligent.htm接口存在sql注入 附POC

@[toc] X管家listUploadIntelligent.htm接口存在sql注入 附POC 免责声明:请勿利用文章内的相关技术从事非法测试,由于传播、利用此文所提供的信息或者工具而造成的任何直接或者间接的后果及损失,均由使用者本人负责,所产生的一切不良后果与文章作者无关。该文章仅供学习用…

MFC dll无法显示tooltip问题

需要在APP 代码中添加hock class CTestApp : public CWinApp { public:CTestApp();HHOOK m_hHook; // 重写 public:static LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam);virtual BOOL InitInstance();DECLARE_MESSAGE_MAP()virtual int ExitIns…

npm i --legacy-peer-deps

npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.1、原因&#xff1a;npm 升级到 7.x以上后&#xff0c;会出现上游依…

Grafana 在 Linux 系统上安装

Grafana 是一个开源的度量分析和可视化套件&#xff0c;它提供了丰富的数据源支持&#xff0c;包括但不限于 Prometheus、InfluxDB、Elasticsearch 等。在 Linux 系统上安装 Grafana 有多种方法&#xff0c;详细操作请参考官网 https://grafana.com/ 1. 使用包管理器安装&…

个股场外期权股票名单有哪些?

今天带你了解期权懂分享&#xff1a;个股场外期权股票名单有哪些&#xff1f;个股期权的标的物是上市的【融资融券】股票&#xff0c;特别是那些市值较大、流动性较好、盈利稳定、市场影响力较大的蓝筹股。 场外个股期权 场外个股期权是一种在非正规交易所&#xff0c;即场外…

Windows系统使用小皮面板搭建Kodcloud结合内网穿透体验私有云盘

文章目录 1.前言2. Kodcloud网站搭建2.1. Kodcloud下载和安装2.2 Kodcloud网页测试 3. cpolar内网穿透的安装和注册4. 本地网页发布4.1 Cpolar云端设置4.2 Cpolar本地设置 5. 公网访问测试6.结语 1.前言 本文主要为大家介绍一款国人自研的在线Web文件管理器可道云&#xff0c;…

MQTT: PUBLISH

PUBLISH DUP flag 当客户端或者服务器第一次尝试发送一个 PUBLISH 消息的时候&#xff0c;DUP 应该未设置为 0。 如果 DUP 为 1&#xff0c; 说明服务器或者客户端正在尝试重新传输一个之前已经发送过的 PUBLISH 消息。 对于 QoS 0 的消息&#xff0c; DUP 应该总是为 0. 对…

vscode自动添加python文件的头部注释

背景: 利用vscode 进行相关配置后可以自动添加头部注释&#xff0c;比如作者信息&#xff0c;文件创建时间、最后修改时间等。 实现&#xff1a; vscode的插件扩展中&#xff1a;安装 koro1FileHeader 插件。 自动添加头部注释和更新时间。 先配置settings.json (ctrlshif…

前后端分离项目遇到的跨域问题解决方案(后端为主)

文章目录 什么是跨域问题&#xff1f;第一种方式 ⇒ 注解解决方案&#xff1a;第二种方式 ⇒ 使用 CorsFilter 方法解决&#xff1a;第三种方式 ⇒ 实现 WebMvcConfigure 接口&#xff0c;添加映射&#xff08;个人推荐&#xff09; 什么是跨域问题&#xff1f; 先说问题&#…

SpringSecurity Oauth2 - 密码模式完成身份认证获取令牌 [自定义UserDetailsService]

文章目录 1. 授权服务器2. 授权类型1. Password (密码模式)2. Refresh Token&#xff08;刷新令牌&#xff09;3. Client Credentials&#xff08;客户端凭证模式&#xff09; 3. AuthorizationServerConfigurerAdapter4. 自定义 TokenStore 管理令牌1. TokenStore 的作用2. Cu…

Pixelmator Pro for Mac 专业图像处理软件【媲美PS的修图软件】

Mac分享吧 文章目录 效果一、下载软件二、开始安装1、双击运行软件&#xff0c;将其从左侧拖入右侧文件夹中&#xff0c;等待安装完毕2、应用程序显示软件图标&#xff0c;表示安装成功 三、运行测试安装完成&#xff01;&#xff01;&#xff01; 效果 一、下载软件 下载软件…

OCSP原理及实践

1.OCSP介绍 在PKI体系中&#xff0c;CA机构颁发合法的证书。使用者可以使用CA根证书验证该证书是否被篡改过&#xff0c;但无法从证书文件验证出证书是否被吊销。因此CA机构会通过发布CRL&#xff08;Certificate Revocation List&#xff09;来告知所有人&#xff0c;哪些证书…